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");
        }
    }