Example #1
0
    protected void loadgrid()
    {
        try
        {
            _obj_kra            = new pms_kraform();
            _obj_kra.KRA_MODE   = 1;
            _obj_kra.KRA_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_kra.LOGIN_ID   = Convert.ToInt32(Session["USER_ID"]);
            DataTable dt = Pms_Bll.get_kra(_obj_kra);
            if (dt.Rows.Count != 0)
            {
                RG_kraform.DataSource = dt;
                RG_kraform.DataBind();
            }
            else
            {
                DataTable dt1 = new DataTable();

                RG_kraform.DataSource = dt1;

                RG_kraform.DataBind();
            }
        }

        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Mgr_Kra", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
 private void LoadGrid()
 {
     try
     {
         _obj_kra            = new pms_kraform();
         _obj_kra.KRA_MODE   = 9;
         _obj_kra.KRA_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
         _obj_kra.LOGIN_ID   = Convert.ToInt32(Session["USER_ID"]);
         DataTable dt = Pms_Bll.get_kra(_obj_kra);
         RG_kraform.DataSource = dt;
         RG_kraform.DataBind();
         if (RG_kraform.Items.Count > 0)
         {
             if (Convert.ToInt32(Session["WRITEFACILITY"]) == 1)
             {
                 tr_btns.Visible = true;
             }
             else
             {
                 tr_btns.Visible = false;
             }
         }
         else
         {
             tr_btns.Visible = false;
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_KRAApprove", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
Example #3
0
    protected void lnk_Edit_Commnad(object sender, CommandEventArgs e)
    {
        try
        {
            i++;
            clearfields();
            chkActive.Checked = false;
            divActive.Visible = true;
            LoadCombos();
            _obj_kra               = new pms_kraform();
            _obj_kra.KRA_MODE      = 2;
            _obj_kra.KRA_ID        = Convert.ToInt32(e.CommandArgument);
            ViewState["EditKraID"] = Convert.ToInt32(e.CommandArgument);
            txt_Objectives.Text    = "";
            DataTable DT = Pms_Bll.get_kra(_obj_kra);
            if (DT.Rows.Count != 0)
            {
                lbl_id.Text          = Convert.ToString(DT.Rows[0]["KRA_ID"]);
                txt_kraname.Text     = Pms_Bll.ReplaceQuote(Convert.ToString(DT.Rows[0]["KRA_NAME"]));
                txt_description.Text = Pms_Bll.ReplaceQuote(Convert.ToString(DT.Rows[0]["KRA_DESCRIPTION"]));
                //txt_Measure.Text = Convert.ToString(DT.Rows[0]["KRA_MEASURE"]);
                rcmb_BUI.SelectedIndex = rcmb_BUI.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["KRA_BU_ID"]));
                //rtxt_KRAID.Text = Pms_Bll.ReplaceQuote(Convert.ToString(DT.Rows[0]["KRA_KRAID"]));

                chkActive.Checked = (!Convert.ToBoolean(DT.Rows[0]["KRA_STATUS"]));

                pnlAddObj.Visible = true;
                rpKraObj.Selected = true;
                LoadKraObjDatabyKraID(Convert.ToInt32(e.CommandArgument));

                RM_kraform.SelectedIndex = 1;
                btn_SAVE.Visible         = true;
                btn_SAVE.Visible         = false;
                btn_Update.Visible       = true;
                txt_description.Enabled  = true;
                txt_kraname.Enabled      = false;
                //rtxt_KRAID.Enabled = false;
                //txt_Measure.Enabled = true;
                rcmb_BUI.Enabled = false;

                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    btn_Update.Visible = false;
                }

                else
                {
                    btn_Update.Visible = true;
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Kraform", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #4
0
    protected void btn_Update_Click(object sender, EventArgs e)
    {
        try
        {
            _obj_kra                 = new pms_kraform();
            _obj_kra.KRA_ID          = Convert.ToInt32(lbl_id.Text);
            _obj_kra.KRA_NAME        = Pms_Bll.ReplaceQuote(Convert.ToString(txt_kraname.Text));
            _obj_kra.KRA_DESCRIPTION = Pms_Bll.ReplaceQuote(Convert.ToString(txt_description.Text));
            _obj_kra.BU_ID           = Convert.ToInt32(rcmb_BUI.SelectedValue);
            //_obj_kra.KRA_MEASURE = Convert.ToString(txt_Measure.Text.Replace("'", "''"));
            _obj_kra.LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_kra.LASTMDFDATE = DateTime.Now;
            _obj_kra.KRA_MODE    = 4;
            //_obj_kra.KRA_KRAID = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_KRAID.Text));
            //_obj_kra.KRA_WEIGHTAGE = Convert.ToInt32(RNT_KraWeightage.Value);

            if (chkActive.Checked)
            {
                _obj_kra.KRA_STATUS = 0;
            }
            else
            {
                _obj_kra.KRA_STATUS = 1;
            }

            bool status = Pms_Bll.set_kra(_obj_kra);
            if (status == true)
            {
                Pms_Bll.ShowMessage(this, "KRA Updated Successfully");
                loadgrid();
                btn_Update.Visible       = true;
                RM_kraform.SelectedIndex = 0;
            }
            else
            {
                Pms_Bll.ShowMessage(this, "Unable to Update the record,Execption Occured");
                return;
            }
        }

        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Kraform", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
 protected void btn_Reject_Click(object sender, EventArgs e)
 {
     try
     {
         bool status = false;
         int  count  = 0;
         for (int index = 0; index < RG_kraform.Items.Count; index++)
         {
             CheckBox chk = (CheckBox)RG_kraform.Items[index].FindControl("chckbtn_Select");
             if (chk.Checked)
             {
                 count++;
                 _obj_kra            = new pms_kraform();
                 _obj_kra.KRA_ID     = Convert.ToInt32(Convert.ToString(RG_kraform.Items[index]["KRA_ID"].Text));
                 _obj_kra.KRA_STATUS = 2;
                 _obj_kra.LASTMDFBY  = Convert.ToInt32(Session["USER_ID"]);
                 _obj_kra.KRA_MODE   = 10;
                 status = Pms_Bll.set_kra(_obj_kra);
             }
         }
         if (count == 0)
         {
             BLL.ShowMessage(this, "Please Select atleast one KRA to Reject.");
             return;
         }
         if (status)
         {
             BLL.ShowMessage(this, "Selected KRA Rejected Successfully.");
             LoadGrid();
             return;
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_KRAApprove", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
Example #6
0
    protected void btn_SAVE_Click1(object sender, EventArgs e)
    {
        try
        {
            string s = Convert.ToString(txt_description.Text);
            string z = Convert.ToString(txt_Measure.Text);
            if (s.Length > 1000)
            {
                Pms_Bll.ShowMessage(this, "Description Cannot Greater Than 1000 Characters");
                return;
            }
            //if (z.Length > 50)
            //{
            //    Pms_Bll.ShowMessage(this, "Measure Cannot Greater Than 50 Characters");
            //    return;

            //}
            _obj_kra            = new pms_kraform();
            _obj_kra.KRA_MODE   = 7;
            _obj_kra.KRA_NAME   = Pms_Bll.ReplaceQuote(Convert.ToString(txt_kraname.Text));
            _obj_kra.BU_ID      = Convert.ToInt32(rcmb_BUI.SelectedValue);
            _obj_kra.KRA_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt = Pms_Bll.get_kra(_obj_kra);
            if (dt.Rows.Count != 0)
            {
                Pms_Bll.ShowMessage(this, "KRA Already Exist");
                return;
            }
            else
            {
                _obj_kra = new pms_kraform();

                _obj_kra.KRA_MODE   = 3;
                _obj_kra.KRA_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_kra.KRA_NAME   = Pms_Bll.ReplaceQuote(Convert.ToString(txt_kraname.Text));

                _obj_kra.KRA_DESCRIPTION = Pms_Bll.ReplaceQuote(Convert.ToString(txt_description.Text));
                _obj_kra.KRA_MEASURE     = Pms_Bll.ReplaceQuote(Convert.ToString(txt_Measure.Text));
                _obj_kra.BU_ID           = Convert.ToInt32(rcmb_BUI.SelectedItem.Value);
                _obj_kra.LASTMDFBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
                _obj_kra.LASTMDFDATE     = DateTime.Now;
                _obj_kra.CREATEDBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
                _obj_kra.CREATEDDATE     = DateTime.Now;
                _obj_kra.KRA_STATUS      = 0;
                //_obj_kra.KRA_WEIGHTAGE = Convert.ToInt32(RNT_KraWeightage.Value);
                _obj_kra.KRA_KRAID = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_KRAID.Text));
                bool status = Pms_Bll.set_kra(_obj_kra);
                if (status == true)
                {
                    Pms_Bll.ShowMessage(this, "KRA Inserted Succesfully");
                    loadgrid();
                    clearfields();
                    RM_kraform.SelectedIndex = 0;
                    return;
                }
                else
                {
                    Pms_Bll.ShowMessage(this, "Unable to Update the record,Execption Occured");
                    return;
                }
            }
        }

        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Mgr_Kra", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }