Exemplo n.º 1
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            _obj_Rec_AssignEmptoRSL = new RECRUITMENT_ASSIGNEMPTORSL();
            _obj_Rec_AssignEmptoRSL.ASSIGNEMP_BUID   = Convert.ToInt32(rcmb_BU.SelectedItem.Value);
            _obj_Rec_AssignEmptoRSL.ASSIGNEMP_EMP_ID = Convert.ToInt32(rcmb_EMP.SelectedItem.Value);
            _obj_Rec_AssignEmptoRSL.ASSIGNEMP_DEPT   = Convert.ToInt32(rcmb_Dept.SelectedItem.Value);
            _obj_Rec_AssignEmptoRSL.ASSIGNEMP_JOBREQ = Convert.ToInt32(rcmb_JobReq.SelectedItem.Value);
            _obj_Rec_AssignEmptoRSL.ORGANISATION_ID  = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Rec_AssignEmptoRSL.CREATEDBY        = Convert.ToInt32(Session["USER_ID"]);
            _obj_Rec_AssignEmptoRSL.LASTMDFBY        = Convert.ToInt32(Session["USER_ID"]);
            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_UPDATE":
                _obj_Rec_AssignEmptoRSL.MODE         = 3;
                _obj_Rec_AssignEmptoRSL.ASSIGNEMP_ID = Convert.ToInt32(lbl_id.Text);
                if (Recruitment_BLL.set_AssigmEMPtoRSL(_obj_Rec_AssignEmptoRSL))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully.");
                    if (Convert.ToInt32(ViewState["EMP_ID"]) != Convert.ToInt32(rcmb_EMP.SelectedItem.Value))
                    {
                        sendMail(Convert.ToInt32(rcmb_EMP.SelectedItem.Value), Convert.ToString(rcmb_JobReq.SelectedItem.Text));
                    }
                    RMP_AssignEmpRSL.SelectedIndex = 0;
                    LoadGrid();
                    RG_AssignEmpRSL.DataBind();
                    return;
                }
                break;

            case "BTN_SAVE":
                _obj_Rec_AssignEmptoRSL.MODE = 2;
                if (Recruitment_BLL.set_AssigmEMPtoRSL(_obj_Rec_AssignEmptoRSL))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully.");
                    sendMail(Convert.ToInt32(rcmb_EMP.SelectedItem.Value), Convert.ToString(rcmb_JobReq.SelectedItem.Text));
                    RMP_AssignEmpRSL.SelectedIndex = 0;
                    LoadGrid();
                    RG_AssignEmpRSL.DataBind();
                    return;
                }
                break;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "AssignEmpRSL", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Exemplo n.º 2
0
 protected void btn_Cancel_Click(object sender, EventArgs e)
 {
     try
     {
         LoadGrid();
         RG_AssignEmpRSL.DataBind();
         RMP_AssignEmpRSL.SelectedIndex = 0;
         rcmb_BU.Items.Clear();
         rcmb_Dept.Items.Clear();
         rcmb_EMP.Items.Clear();
         rcmb_JobReq.Items.Clear();
         lbl_id.Text = string.Empty;
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "AssignEmpRSL", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();
                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("Assign Employee to Resume Short Listing");//Self Appraisal");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                else
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }


                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    RG_AssignEmpRSL.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    btn_Save.Visible   = false;
                    btn_Update.Visible = false;
                }
                else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }
                LoadGrid();
                RG_AssignEmpRSL.DataBind();
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "AssignEmpRSL", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }