Пример #1
0
    private void InitControls()
    {
        //Load header drop down data
        ParamTypeRepository paramTypeRepo = new ParamTypeRepository();
        ddlUnit.DataValueField = "TypeID";
        ddlUnit.DataTextField = "Label";
        ddlUnit.DataSource = paramTypeRepo.FindAll();
        ddlUnit.DataBind();

        ParamUserRepository paramUserRepo = new ParamUserRepository();
        ddlInterviewer.DataValueField = "UserID";
        ddlInterviewer.DataTextField = "LastName";

        ddlInterviewer.DataSource = paramUserRepo.GetAllUser(true);
        ddlInterviewer.DataBind();

        if (!string.IsNullOrEmpty(Request.QueryString["CandidateID"]))
            lnkCanContactAdd.OnClientClick = string.Format("return OncandidateContactAddClientClicked('{0}')",Request.QueryString["CandidateID"]);
        else
            lnkCanContactAdd.OnClientClick = string.Format("return OncandidateContactAddClientClicked('')");
        //if (!string.IsNullOrEmpty(Request.QueryString["CandidateId"]))
        //{
        //    radTabStripCandidateProfile.OnClientLoad = "javascript:onLoadCandidateProfile();";
        //}

        if (!string.IsNullOrEmpty(Request.QueryString["CandidateID"]))
            lnkAddNewDocument.Attributes.Add("onclick", string.Format("OnDocumentEditClientClicked({0},\"\")", Request.QueryString["CandidateID"]));

        //tab study
        HttpCookie studyGridPageSizeCookie = Request.Cookies.Get("cand_studygrdps");
        if (studyGridPageSizeCookie != null)
        {
            if (!string.IsNullOrEmpty(studyGridPageSizeCookie.Value))
                gridStudies.PageSize = Convert.ToInt32(studyGridPageSizeCookie.Value) > 0 ? Convert.ToInt32(studyGridPageSizeCookie.Value) : gridStudies.PageSize;
        }
        HttpCookie experienceGridPageSizeCookie = Request.Cookies.Get("cand_expgrdps");
        if (experienceGridPageSizeCookie != null)
        {
            if (!string.IsNullOrEmpty(experienceGridPageSizeCookie.Value))
                gridExperience.PageSize = Convert.ToInt32(experienceGridPageSizeCookie.Value) > 0 ? Convert.ToInt32(experienceGridPageSizeCookie.Value) : gridExperience.PageSize;
        }

        //tab actions
        HttpCookie actionGridPageSizeCookie = Request.Cookies.Get("cand_actgrdps");
        if (actionGridPageSizeCookie != null)
        {
            if (!string.IsNullOrEmpty(actionGridPageSizeCookie.Value))
                gridActions.PageSize = Convert.ToInt32(actionGridPageSizeCookie.Value) > 0 ? Convert.ToInt32(actionGridPageSizeCookie.Value) : gridActions.PageSize;
        }
        //tab Document
        HttpCookie docGridPageSizeCookie = Request.Cookies.Get("cand_docgrdps");
        if (docGridPageSizeCookie != null)
        {
            if (!string.IsNullOrEmpty(docGridPageSizeCookie.Value))
                grdDocuments.PageSize = Convert.ToInt32(docGridPageSizeCookie.Value) > 0 ? Convert.ToInt32(docGridPageSizeCookie.Value) : grdDocuments.PageSize;
        }
    }
 private void BindGridData()
 {
     ParamUserRepository repo = new ParamUserRepository();
     gridUsers.DataSource = repo.GetAllUser(false);
 }
Пример #3
0
    private void BindData()
    {
        BindLast5ViewedCandidate();
        BindLast5ViewedCompany();

        //fill Job sections
        BindProfileData();
        BindFunctionData();
        BindLocationData();
        BindResponsible();
        //Action
        ddlTypeAction.DataValueField = "ParamActionID";
        ddlTypeAction.DataTextField = "Label";
        IList<ParamTypeAction> list = new List<ParamTypeAction>();
        list = new ParamTypeActionRepository().FindAll();
        list.Insert(0, new ParamTypeAction(-1, string.Empty));
        ddlTypeAction.DataSource = list;
        ddlTypeAction.DataBind();

        ParamUserRepository paramUserRepo = new ParamUserRepository();
        ddlResponsibleAction.DataValueField = "UserID";
        ddlResponsibleAction.DataTextField = "LastName";
        ddlResponsibleAction.DataSource = paramUserRepo.GetAllUser(true);
        ddlResponsibleAction.DataBind();

        if (SessionManager.CurrentUser != null)
        {
            ddlResponsibleAction.SelectedValue = SessionManager.CurrentUser.UserID;
        }

        //Invoice
        ddlInvoiceType.Items.Add(new RadComboBoxItem(ResourceManager.GetString("allText"), ""));
        ddlInvoiceType.Items.Add(new RadComboBoxItem("Invoice", "I"));
        ddlInvoiceType.Items.Add(new RadComboBoxItem("Credite note", "C"));
        ddlInvoiceType.SelectedValue = "I";

        ddlFiscalYear.Items.Add(new RadComboBoxItem(ResourceManager.GetString("allText"), ""));
        for (int year = DateTime.Today.Year; year >= 2000; year--)
        {
            ddlFiscalYear.Items.Add(new RadComboBoxItem(year.ToString(), year.ToString()));
        }
        ddlFiscalYear.SelectedValue = DateTime.Today.Year.ToString();
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (SessionManager.CurrentUser == null)
        {
            Common.RedirectToLoginPage(this);
            return;
        }
        else if (!IsPostBack)
        {
            FillLabelLanguage();
            InitControls();

            //Fill data for combobox
            ddlTypeAction.DataValueField = "ParamActionID";
            ddlTypeAction.DataTextField = "Label";
            ParamTypeActionRepository paramTypeActionRepo = new ParamTypeActionRepository();
            ddlTypeAction.DataSource = paramTypeActionRepo.FindAll();
            ddlTypeAction.DataBind();

            ddlResponsible.DataValueField = "UserID";
            ddlResponsible.DataTextField = "LastName";
            ParamUserRepository userRepo = new ParamUserRepository();
            ddlResponsible.DataSource = userRepo.GetAllUser(true);
            ddlResponsible.DataBind();
            ddlResponsible.SelectedValue = SessionManager.CurrentUser.UserID;

            bool isCompany = false;
            bool isCandidate = false;
            if (!string.IsNullOrEmpty(Request.QueryString["type"]))
            {
                if (Request.QueryString["type"] == "company")
                {
                    isCompany = true;
                    btnCompany.Enabled = false;
                    ddlCompany.Enabled = false;
                }
                else if (Request.QueryString["type"] == "candidate")
                {
                    isCandidate = true;
                    btnCandidate.Enabled = false;
                    ddlCandidate.Enabled = false;
                }
                else if (Request.QueryString["type"] == "action"
                        && string.IsNullOrEmpty(Request.QueryString["ActionID"]))
                {
                    if (SessionManager.CurrentUser != null)
                        ddlResponsible.SelectedValue = SessionManager.CurrentUser.UserID;
                }
            }

            if (SessionManager.CurrentCompany != null && isCompany)
            {
                ddlCompany.Items.Clear();
                ddlCompany.Items.Add(new RadComboBoxItem(SessionManager.CurrentCompany.CompanyName, SessionManager.CurrentCompany.CompanyID.ToString()));
                ddlCompany.SelectedIndex = 0;

                hiddenCompanyId.Value = SessionManager.CurrentCompany.CompanyID.ToString();
                txtCompany.Text = SessionManager.CurrentCompany.CompanyName;
                BindContactListByCompany(SessionManager.CurrentCompany.CompanyID);
            }
            if (SessionManager.CurrentCandidate != null && isCandidate)
            {
                hiddenCandidateId.Value = SessionManager.CurrentCandidate.CandidateId.ToString();
                txtCandidate.Text = SessionManager.CurrentCandidate.FirstName + " " + SessionManager.CurrentCandidate.LastName;
                ddlCandidate.Items.Add(new RadComboBoxItem(SessionManager.CurrentCandidate.FirstName + " " + SessionManager.CurrentCandidate.LastName, SessionManager.CurrentCandidate.CandidateId.ToString()));
                ddlCandidate.SelectedIndex = 0;
            }

            if (!string.IsNullOrEmpty(Request.QueryString["ActionID"]))
            {

                int actionID = int.Parse(Request.QueryString["ActionID"]);
                ActionRepository repo = new ActionRepository();
                Neos.Data.Action action = repo.GetActionByActionID(actionID);
                if (action.CompanyID.HasValue)
                {
                    hiddenCompanyId.Value = action.CompanyID.Value.ToString();

                    BindContactListByCompany(action.CompanyID.Value);
                }
                if (action.CandidateID.HasValue)
                {

                    hiddenCandidateId.Value = action.CandidateID.Value.ToString();
                }
                if (action.ContactID.HasValue)
                {
                    ddlContact.SelectedValue = action.ContactID.Value.ToString();
                }
                else
                    ddlContact.SelectedValue = "-1";

                txtTaskNbr.Text = action.ActionID.ToString();
                chkActive.Checked = action.Actif;
                datDateAction.SelectedDate = action.DateAction;
                radTimeHour.SelectedDate = action.Hour;
                if (action.TypeAction.HasValue)
                    ddlTypeAction.SelectedValue = action.TypeAction.Value.ToString();
                datCreationDate.SelectedDate = action.DateCreation;
                txtCompany.Text = action.CompanyName;
                txtCandidate.Text = action.CandidateFullName;

                txtAppointmentPlace.Text = action.LieuRDV;
                txtCompanyResult.Text = action.ResultCompany;
                txtCandidateResult.Text = action.ResultCandidate;
                txtDescription.Text = action.DescrAction;
                ddlResponsible.SelectedValue = action.Responsable;

                //Company dropdownlist
                if (action.CompanyID.HasValue)
                {
                    ddlCompany.Items.Add(new RadComboBoxItem(action.CompanyName, action.CompanyID.ToString()));
                    ddlCompany.SelectedIndex = 0;
                }
                //candidate dropdownlist
                if (action.CandidateID.HasValue)
                {
                    ddlCandidate.Items.Add(new RadComboBoxItem(action.CandidateFullName, action.CandidateID.ToString()));
                    ddlCandidate.SelectedIndex = 0;
                }
            }
        }

        string script = "<script type='text/javascript'>";
        script += "onLoadActionDetailPage();";
        script += "</script>";
        if (!ClientScript.IsClientScriptBlockRegistered("LoadActionDetailPage"))
            ClientScript.RegisterStartupScript(this.GetType(), "LoadActionDetailPage", script);
    }