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)");
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.User.Identity.IsAuthenticated)
            {
                if (Roles.IsUserInRole("organization"))
                {
                    Session["currentUserRole"] = "organization";
                }
                else if (Roles.IsUserInRole("employee"))
                {
                    Session["currentUserRole"] = "employee";
                }
            }
            //FormsAuthentication.RedirectToLoginPage("~/Account/Login.aspx?r=e");
            try
            {
                Assembly ass = Assembly.Load("App_GlobalResources");
                rm = new ResourceManager("Resources.Resource", ass);
                facade = new BusinessFacade(myConn);
                //Page.Form.DefaultButton = btn_Search.UniqueID;

                if (Request.Params["r"] == "e")
                {
                    btn_CandidateSite.Visible = true;
                    btn_EmployerSite.Visible = false;
                }
                if (Roles.IsUserInRole("Organization"))
                {
                    btn_CandidateSite.Visible = true;
                    btn_EmployerSite.Visible = false;

                    //invi candidate site
                    hpl_SchoolJob.Visible = false;
                    hpl_ExecJob.Visible = false;
                    htlHomeMenu2.Visible = false;
                    hplmyAccountMenu2.Visible = false;
                    HyperLink2.Visible = false;
                    btn_Search.Visible = false;
                    lbl_AvaiJob.Visible = false;
                    hpl_AdvanceSearch.Visible = false;

                    //show emp site
                    hpl_CvSearch.Visible = true;
                    HyperLink1.Visible = true;
                    hpl_em_myAccount.Visible = true;
                    HyperLink3.Visible = true;
                    HyperLink4.Visible = true;
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", "<script>document.getElementById('li4').style.display = 'none';document.getElementById('li5').style.display = 'none';</script>");
                    //Panel1.Visible = false;
                    btn_Search_Cv.Visible = true;
                    //Other
                    lbl_SearchLabel.Text = rm.GetString("ResumesSearch");
                    //Panel_Gallery.Visible = false;
                    //Panel_PhongBi_emp.Visible = true;
                    int avaiResumes = facade.GetAvaiResumes();
                    lbl_AvaiResumes.Text = avaiResumes + " " + rm.GetString("resumesavailable"); ;
                    lbl_AvaiResumes.Visible = true;
                    hpl_AdvanceSearchCV.Visible = true;
                }

                AvailableJobCount = facade.GetAvailableJobCount();
                lbl_AvaiJob.Text = AvailableJobCount.ToString() + " " + rm.GetString("jobAvai");
                if (!IsPostBack)
                {
                    Page.Header.DataBind();
                }
                repeater_GetOrgType.DataSource = facade.GetAllOrganizationType();
                repeater_GetOrgType.DataBind();
                Repeater_Footer.DataSource = repeater_GetOrgType.DataSource;
                Repeater_Footer.DataBind();
                if (!Session.IsNewSession && !IsPostBack)
                {
                    try
                    {
                        setKeyword(Session["keyword"].ToString());
                        //setCitizenship(Session["citizenship"].ToString());
                    }
                    catch (NullReferenceException)
                    {

                    }
                }

                MasterDataBind();
                //else
                //{
                //ClearSession();
                //}
                //ClearSession();

                if (Roles.IsUserInRole("admin") || Roles.IsUserInRole("superadmin"))
                {
                    hpl_adminsite.Visible = true;
                    hpl_adminsite.Text = "Back end";
                    hpl_adminsite.NavigateUrl = "~/admintj/User.aspx";
                    hpl_TeacherTraining.Visible = true;
                    hpl_List.Visible = true;
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopupScript", "<script>alert('" + ex.Message + "');</script>");
            }
        }
        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)
        {
            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>");
            }
        }