protected void Page_Load(object sender, EventArgs e) { facade = new BusinessFacade(myConn); //ToolkitScriptManager objScriptManager = (ToolkitScriptManager)this.Master.FindControl("ToolkitScriptManager1"); //objScriptManager.AsyncPostBackTimeout = 36000; //objScriptManager.RegisterAsyncPostBackControl(ddlCitizenship); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>showhideOnStartUp();</script>"); if (!IsPostBack) { List<Location> loList = facade.GetAllLocation(); ddlJobLocation.Items.Insert(0, new ListItem(string.Empty, string.Empty)); foreach (Location l in loList) { ListItem li = Utils.DecideLangDropdown(l.LName, l.LName_vn); ddlJobLocation.Items.Add(li); } List<Citizenship> ciList = facade.GetAllCitizenship(); ddlCitizenship.Items.Insert(0, new ListItem(string.Empty, string.Empty)); foreach (Citizenship ci in ciList) { ListItem li = Utils.DecideLangDropdown(ci.CitizenshipName, ci.CitizenshipName_vn); ddlCitizenship.Items.Add(li); } List<OrganizationType> otList = facade.GetAllOrganizationType(); OrganizationType.Items.Insert(0, new ListItem(string.Empty, string.Empty)); if (otList != null) { foreach (OrganizationType sc in otList) { ListItem li = Utils.DecideLangDropdown(sc.Name, sc.Name_vn); if (sc.Name == "Private Tutor") { OrganizationType.Items.Insert(1, li); continue; } OrganizationType.Items.Add(li); } } else { ListItem li = new ListItem("N/A", "N/A"); OrganizationType.Items.Add(li); } ddl_SchoolType.Items.Insert(0, new ListItem(string.Empty, string.Empty)); List<SchoolType> stList = facade.GetSchoolType(); foreach (SchoolType st in stList) { ListItem li = Utils.DecideLangDropdown(st.Name, st.Name_vn); ddl_SchoolType.Items.Add(li); } } if (!IsPostBack) { try { ViewState["PreviousPageUrl"] = Request.UrlReferrer.ToString(); } catch (Exception) { Response.Redirect("~/Employer/EmployerSite.aspx"); } } if (!IsPostBack) { string email = mu.Email; if (Roles.GetRolesForUser(Page.User.Identity.Name).Contains("Organization")) { pnl_Employer.Visible = true; username = mu.UserName; Email.Text = email; //ddl_Salutation.SelectedItem.Text = Context.Profile.GetPropertyValue("").ToString(); ListItem li_Salutation = ddl_Salutation.Items.FindByValue(Context.Profile.GetPropertyValue("Employer.Salutation").ToString()); if (li_Salutation != null) { li_Salutation.Selected = true; } txt_FirstName.Text = Context.Profile.GetPropertyValue("Employer.FirstName").ToString(); txt_Middle.Text = Context.Profile.GetPropertyValue("Employer.MiddleName").ToString(); txt_LastName.Text = Context.Profile.GetPropertyValue("Employer.LastName").ToString(); txt_PrimaryPhone.Text = Context.Profile.GetPropertyValue("Employer.Phone").ToString(); if (Context.Profile.GetPropertyValue("Employer.PersonalImage").ToString() == "") { Img_PersonalImage.ImageUrl = "~/images/companyLogo/no_image_100x100.jpg"; } else { Img_PersonalImage.ImageUrl = General.EMP_HIRING_ADVICE + mu.ProviderUserKey.ToString() + "/" + Context.Profile.GetPropertyValue("Employer.PersonalImage").ToString(); } if (Context.Profile.GetPropertyValue("Organization.Logo") == null) { img_Logo.ImageUrl = "~/images/companyLogo/no_image_100x100.jpg"; } else { img_Logo.ImageUrl = General.EMP_LOGO + mu.UserName + "/" + Context.Profile.GetPropertyValue("Organization.Logo").ToString(); } OrganizationName_txt.Text = Context.Profile.GetPropertyValue("Organization.OrganizationName").ToString(); Website_txt.Text = Context.Profile.GetPropertyValue("Organization.Website").ToString(); BriefInfo_txt.Text = Context.Profile.GetPropertyValue("Organization.BriefInfo").ToString(); Address1_txt.Text = Context.Profile.GetPropertyValue("Organization.Address1").ToString(); Phone1_txt.Text = Context.Profile.GetPropertyValue("Organization.PhoneNumber1").ToString(); FaxNumber_txt.Text = Context.Profile.GetPropertyValue("Organization.FaxNumber").ToString(); ListItem selectedItem_City = ddlJobLocation.Items.FindByValue(Context.Profile.GetPropertyValue("Organization.City").ToString()); if (selectedItem_City != null) { selectedItem_City.Selected = true; } ListItem selectedItem_Country = ddlCitizenship.Items.FindByValue(Context.Profile.GetPropertyValue("Organization.Country").ToString()); if (selectedItem_Country != null) { selectedItem_Country.Selected = true; } ListItem selectedItem_OrgType = OrganizationType.Items.FindByValue(Context.Profile.GetPropertyValue("Organization.OrganizationType").ToString()); if (selectedItem_OrgType != null) { selectedItem_OrgType.Selected = true; } ListItem selectedItem_schType = ddl_SchoolType.Items.FindByValue(Context.Profile.GetPropertyValue("Organization.SchoolType").ToString()); if (selectedItem_schType != null) { selectedItem_schType.Selected = true; } ZipCode_txt.Text = Context.Profile.GetPropertyValue("Organization.ZipCode").ToString(); } else Response.Redirect("~/publicArea/errorpages/Error403.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { facade = new BusinessFacade(myConn); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>showhideOnStartUp();</script>"); if (!IsPostBack) { List<Location> loList = facade.GetAllLocation(); ddlJobLocation.Items.Insert(0, new ListItem(string.Empty, string.Empty)); foreach (Location l in loList) { ListItem li = Utils.DecideLangDropdown(l.LName, l.LName_vn); ddlJobLocation.Items.Add(li); } List<Citizenship> ciList = facade.GetAllCitizenship(); ddlCitizenship.Items.Insert(0, new ListItem(string.Empty, string.Empty)); foreach (Citizenship ci in ciList) { ListItem li = Utils.DecideLangDropdown(ci.CitizenshipName, ci.CitizenshipName_vn); ddlCitizenship.Items.Add(li); } List<OrganizationType> otList = facade.GetAllOrganizationType(); OrganizationType.Items.Insert(0, new ListItem(string.Empty, string.Empty)); if (otList != null) { foreach (OrganizationType sc in otList) { ListItem li = Utils.DecideLangDropdown(sc.Name, sc.Name_vn); if (sc.Name == "Private Tutor") { OrganizationType.Items.Insert(1, li); continue; } OrganizationType.Items.Add(li); } } else { ListItem li = new ListItem("N/A", "N/A"); OrganizationType.Items.Add(li); } ddl_SchoolType.Items.Insert(0, new ListItem(string.Empty, string.Empty)); List<SchoolType> stList = facade.GetSchoolType(); foreach (SchoolType st in stList) { ListItem li = Utils.DecideLangDropdown(st.Name, st.Name_vn); ddl_SchoolType.Items.Add(li); } } if (!IsPostBack) { txt_OrgName.Text = Context.Profile.GetPropertyValue("Organization.OrganizationName").ToString(); txt_website.Text = Context.Profile.GetPropertyValue("Organization.Website").ToString(); ListItem selectedItem_City = ddlJobLocation.Items.FindByValue(Context.Profile.GetPropertyValue("Organization.City").ToString()); if (selectedItem_City != null) { selectedItem_City.Selected = true; } ListItem selectedItem_Country = ddlCitizenship.Items.FindByValue(Context.Profile.GetPropertyValue("Organization.Country").ToString()); if (selectedItem_Country != null) { selectedItem_Country.Selected = true; } ListItem selectedItem_OrgType = OrganizationType.Items.FindByValue(Context.Profile.GetPropertyValue("Organization.OrganizationType").ToString()); if (selectedItem_OrgType != null) { selectedItem_OrgType.Selected = true; } ListItem selectedItem_schType = ddl_SchoolType.Items.FindByValue(Context.Profile.GetPropertyValue("Organization.SchoolType").ToString()); if (selectedItem_schType != null) { selectedItem_schType.Selected = true; } try { ViewState["PreviousPageUrl"] = Request.UrlReferrer.ToString(); } catch (Exception) { Response.Redirect("~/Employer/EmployerSite.aspx"); } } txt_CourseContent.Attributes.Add("onkeydown", "textCounter(this,'" + Label9.ClientID + "', 5000)"); txt_benefit.Attributes.Add("onkeydown", "textCounter2(this,'" + Label10.ClientID + "', 5000)"); }
protected void Page_Load(object sender, EventArgs e) { try { Form.DefaultButton = btn_Search.UniqueID; facade = new BusinessFacade(myConn); dl_adminCate.DataSource = facade.GetChildCategory(1); dl_adminCate.DataBind(); dl_Fromk12Cate.DataSource = facade.GetChildCategory(2); dl_Fromk12Cate.DataBind(); dl_AcademicCate.DataSource = facade.GetChildCategory(3); dl_AcademicCate.DataBind(); dl_Joblevel.DataSource = facade.GetAllJobRole(); dl_Joblevel.DataBind(); dl_WorkPlace.DataSource = facade.GetAllLocation(); dl_WorkPlace.DataBind(); Assembly ass = Assembly.Load("App_GlobalResources"); ResourceManager rm = new ResourceManager("Resources.Resource", ass); ddl_citizenship.Items.Insert(0, new ListItem(rm.GetString("Pleaseselect"), string.Empty)); List<Citizenship> ctList = facade.GetAllCitizenship(); foreach (Citizenship ct in ctList) { ListItem li = Utils.DecideLangDropdown(ct.CitizenshipName, ct.CitizenshipName_vn); if (li.Value == "Afghanistan" || li.Value == "Afghanistan") { ListItem l = new ListItem("------------------------------", ""); ddl_citizenship.Items.Add(l); } ddl_citizenship.Items.Add(li); } dl_emplType.DataSource = facade.GetAllEmploymentType(); dl_emplType.DataBind(); ddl_OrgType.Items.Insert(0, new ListItem(rm.GetString("Pleaseselect"), string.Empty)); List<OrganizationType> oType = facade.GetAllOrganizationType(); foreach (OrganizationType ot in oType) { ListItem li = Utils.DecideLangDropdown(ot.Name, ot.Name_vn); ddl_OrgType.Items.Add(li); } ddl_SchoolType.Items.Insert(0, new ListItem(rm.GetString("Pleaseselect"), string.Empty)); List<SchoolType> stList = facade.GetSchoolType(); foreach (SchoolType st in stList) { ListItem li = Utils.DecideLangDropdown(st.Name, st.Name_vn); ddl_SchoolType.Items.Add(li); } //Load job title TitleList = new AdvanceSearchLogic(myConn).GetAllJobTitle(); ArrTitle = ""; foreach (String str in TitleList) { ArrTitle += str + ","; } } catch (Exception ex) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopupScript", "<script>alert('"+ex.Message+"');</script>"); } }