您目前尚未登陆,请选择【登陆】或【注册
首页->其他源码->人才网初学者工具包源码>>employer/AddEditPosting.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:人才网初学者工具包源码


当前文件路径:JobSiteStarterKit/employer/AddEditPosting.aspx.cs 文件类型
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Web; 5using System.Web.Security; 6using System.Web.UI; 7using System.Web.UI.WebControls; 8using System.Web.UI.WebControls.WebParts; 9using System.Web.UI.HtmlControls; 10using JobSiteStarterKit.BOL; 11 12public partial class AddEditPosting_aspx : Page 13{ 14 protected void Page_Load(object sender, EventArgs e) 15 { 16 if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["employerrolename"])) 17 { 18 Response.Redirect("~/customerrorpages/NotAuthorized.aspx"); 19 } 20 21 if (!Page.IsPostBack) 22 { 23 if (Company.GetCompany(User.Identity.Name) == null) 24 { 25 Response.Redirect("~/customerrorpages/profilenotfound.aspx"); 26 } 27 28 if (Request.QueryString["id"] == null) 29 { 30 DetailsView1.DefaultMode = DetailsViewMode.Insert; 31 } 32 else 33 { 34 DetailsView1.DefaultMode = DetailsViewMode.ReadOnly; 35 } 36 } 37 } 38 protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e) 39 { 40 41 DropDownList ddl; 42 ddl = (DropDownList)DetailsView1.FindControl("ddlStateInsert"); 43 e.Values["StateID"] = ddl.SelectedValue; 44 45 ddl = (DropDownList)DetailsView1.FindControl("ddlCountryInsert"); 46 e.Values["CountryID"] = ddl.SelectedValue; 47 48 ddl = (DropDownList)DetailsView1.FindControl("ddlEduLevelInsert"); 49 e.Values["EducationLevelID"] = ddl.SelectedValue; 50 51 ddl = (DropDownList)DetailsView1.FindControl("ddlJobTypeInsert"); 52 e.Values["JobTypeID"] = ddl.SelectedValue; 53 54 e.Values["PostedBy"] = Profile.UserName; 55 e.Values["CompanyID"]=Profile.Employer.CompanyID.ToString(); 56 e.Values["PostingDate"]= DateTime.Today.ToString("MM/dd/yyyy"); 57 58 } 59 60 protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e) 61 { 62 DropDownList ddl; 63 ddl = (DropDownList)DetailsView1.FindControl("ddlStateUpdate"); 64 e.NewValues["StateID"] = ddl.SelectedValue; 65 66 ddl = (DropDownList)DetailsView1.FindControl("ddlCountryUpdate"); 67 e.NewValues["CountryID"] = ddl.SelectedValue; 68 69 ddl = (DropDownList)DetailsView1.FindControl("ddlEduLevelUpdate"); 70 e.NewValues["EducationLevelID"] = ddl.SelectedValue; 71 72 ddl = (DropDownList)DetailsView1.FindControl("ddlJobTypeUpdate"); 73 e.NewValues["JobTypeID"] = ddl.SelectedValue; 74 75 e.NewValues["PostedBy"] = Profile.UserName; 76 e.NewValues["CompanyID"] = Profile.Employer.CompanyID.ToString(); 77 e.NewValues["PostingDate"] = DateTime.Today.ToString("MM/dd/yyyy"); 78 79 } 80 81 protected void DetailsView1_ItemDeleted(object sender, DetailsViewDeletedEventArgs e) 82 { 83 Response.Redirect("~/" + ConfigurationManager.AppSettings["employerfolder"] + "/jobpostings.aspx"); 84 } 85 86 protected void ddlCountryUpdate_SelectedIndexChanged(object sender, EventArgs e) 87 { 88 DropDownList ddl; 89 ddl = (DropDownList)sender; 90 ObjectDataSource2.SelectParameters["countryid"].DefaultValue = ddl.SelectedValue; 91 ObjectDataSource2.Select(); 92 } 93 94 protected void ddlCountryInsert_SelectedIndexChanged(object sender, EventArgs e) 95 { 96 DropDownList ddl; 97 ddl = (DropDownList)sender; 98 ObjectDataSource2.SelectParameters["countryid"].DefaultValue = ddl.SelectedValue; 99 ObjectDataSource2.Select(); 100 101 } 102 103 protected void DetailsView1_DataBound(object sender, EventArgs e) 104 { 105 DropDownList ddl; 106 ddl = (DropDownList)DetailsView1.FindControl("ddlCountryUpdate"); 107 if (ddl != null) 108 { 109 ObjectDataSource2.SelectParameters["countryid"].DefaultValue = ddl.SelectedValue; 110 ObjectDataSource2.Select(); 111 112 } 113 114 } 115 116} 117
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:人才网初学者工具包源码

- 博易单用户博客V1.0Beta项目源码

- Atlas中UpdatePanel无刷新Ta..

- 成幻(CHSNS#)SNS1.22版源码

- 捷丰网络硬盘源码

- 51aspx可拖曳简单新闻系统

- 超越简单同学录源码

- 某市人口普查系统源码

- 明日多用户Blog系统源码

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号