Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.ViewJobtitle, Request.Cookies["user"]["Permission"].ToString()))
                {
                    Response.Redirect("~/HR/UnAuthorized.aspx");
                }
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["id"].ToString() != null)
                {
                    if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                    {
                        Jobtitle jobtitle = new Jobtitle();
                        jobtitle.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                        txtJobTitle.Text       = jobtitle.JobTitle;
                        txtJobDescription.Text = jobtitle.JobDescription;
                        txtNote.Text           = jobtitle.Note;

                        btnEdit.Visible = true;
                    }
                    else
                    {
                        btnEdit.Visible = false;
                    }
                }
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.ViewKPI, Request.Cookies["user"]["Permission"].ToString()))
                {
                    Response.Redirect("~/HR/UnAuthorized.aspx");
                }
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["id"].ToString() != null)
                {
                    if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                    {
                        KPIS kpi = new KPIS();
                        kpi.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                        Jobtitle title = new Jobtitle();
                        title.get(kpi.JobTitleID);
                        ddlJobTitle.Text      = title.JobTitle;
                        txtKeyIndicator.Text  = kpi.KeyPerformanceIndicator;
                        txtMaximumRating.Text = kpi.MaximumRating.ToString();
                        txtMinimumRating.Text = kpi.MinimumRating.ToString();
                        if (kpi.DefaultScale == 1)
                        {
                            cbDefault.Checked = true;
                        }
                        else
                        {
                            cbDefault.Checked = false;
                        }

                        btnEdit.Visible = true;
                    }
                    else
                    {
                        btnEdit.Visible = false;
                    }
                }
            }
        }