//-------Insert------------------------------------
        public int SaveEmployee_Transfer(HRM_EMP_TRANSFER objTrns, string employeeID)
        {
            try
            {
                //---------------Update Employee Master-----------------
                HRM_PersonalInformations objEmpUpdate = _context.HRM_PersonalInformations.First(x => x.EID == employeeID);
                objEmpUpdate.RegionsId           = objTrns.Regions_ID_TO;
                objEmpUpdate.OfficeId            = objTrns.Office_ID_TO;
                objEmpUpdate.DepartmentId        = objTrns.DPT_ID_TO;
                objEmpUpdate.SectionId           = objTrns.SEC_ID_TO;
                objEmpUpdate.SubSectionId        = objTrns.SUB_SEC_ID_TO;
                objEmpUpdate.DesginationId       = objTrns.DEG_ID_TO;
                objEmpUpdate.Grade               = objTrns.GradeTo;
                objEmpUpdate.Salary              = objTrns.GorssSalaryTo;
                objEmpUpdate.EMP_TRANSFER_STATUS = true;
                _context.SaveChanges();

                _context.HRM_EMP_TRANSFER.AddObject(objTrns);
                _context.SaveChanges();

                return(1);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public int SaveEmployee_Transfer(HRM_EMP_TRANSFER objTrns, string employeeID, decimal PreviousGrossSalary)
        {
            try
            {
                //---------------Update Employee Master-----------------
                HRM_PersonalInformations objEmpUpdate = _context.HRM_PersonalInformations.First(x => x.EID == employeeID);
                objEmpUpdate.RegionsId     = objTrns.Regions_ID_TO;
                objEmpUpdate.OfficeId      = objTrns.Office_ID_TO;
                objEmpUpdate.DepartmentId  = objTrns.DPT_ID_TO;
                objEmpUpdate.SectionId     = objTrns.SEC_ID_TO;
                objEmpUpdate.SubSectionId  = objTrns.SUB_SEC_ID_TO;
                objEmpUpdate.DesginationId = objTrns.DEG_ID_TO;
                objEmpUpdate.Grade         = objTrns.GradeTo;
                objEmpUpdate.Salary        = objTrns.GorssSalaryTo;

                if (objTrns.Status == "TWSI" || objTrns.Status == "TWOSI")
                {
                    objEmpUpdate.EMP_TRANSFER_STATUS = true;
                }
                else
                {
                    objEmpUpdate.EMP_TRANSFER_STATUS = objEmpUpdate.EMP_TRANSFER_STATUS;
                }

                if (objTrns.Status == "TWSI" || objTrns.Status == "PWSI")
                {
                    InsertSalaryIncrementLog(objTrns, employeeID, PreviousGrossSalary);
                }

                _context.SaveChanges();
                _context.HRM_EMP_TRANSFER.AddObject(objTrns);
                _context.SaveChanges();

                return(1);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 private void InsertSalaryIncrementLog(HRM_EMP_TRANSFER objTrns, string employeeID, decimal PreviousGrossSalary)
 {
     try
     {
         HRM_SalaryIncrementSLog _hrmSalaryIncrementlog = new HRM_SalaryIncrementSLog();
         _hrmSalaryIncrementlog.EID                   = employeeID;
         _hrmSalaryIncrementlog.EffectiveDate         = DateTime.Now;
         _hrmSalaryIncrementlog.IncrementDate         = DateTime.Now;
         _hrmSalaryIncrementlog.SalaryIncrementStatus = "Transfer/Promotion";
         _hrmSalaryIncrementlog.previousSalary        = PreviousGrossSalary;
         _hrmSalaryIncrementlog.IncrementSalary       = objTrns.GorssSalaryTo;
         _hrmSalaryIncrementlog.EDIT_DATE             = objTrns.EDIT_DATE;
         _hrmSalaryIncrementlog.EDIT_USER             = objTrns.EDIT_USER;
         _hrmSalaryIncrementlog.OCODE                 = objTrns.OCODE;
         _context.HRM_SalaryIncrementSLog.AddObject(_hrmSalaryIncrementlog);
         _context.SaveChanges();
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #4
0
 public int SaveEmployee_Transfer(HRM_EMP_TRANSFER objTrns, string employeeID, decimal PreviousGrossSalary)
 {
     return(objCtx_DAL.SaveEmployee_Transfer(objTrns, employeeID, PreviousGrossSalary));
 }
Example #5
0
 //-------Insert------------------------------------
 public int SaveEmployee_Transfer(HRM_EMP_TRANSFER objTrns, string employeeID)
 {
     return(objCtx_DAL.SaveEmployee_Transfer(objTrns, employeeID));
 }
Example #6
0
        protected void btnTrStaffSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                HRM_EMP_TRANSFER objTrns    = new HRM_EMP_TRANSFER();
                string           employeeID = Convert.ToString(txtEid_TRNS.Text);
                string           desName    = drpdwnDesigantion.SelectedItem.ToString();
                string           grade      = txtbxGarde.Text;
                decimal?         Gosssalary = Convert.ToDecimal(txtbxGrossSalary.Text);
                bool             Status     = CheckDesignation(desName, grade, Gosssalary);
                if (Status == false)
                {
                    InsertDesgination(desName, grade, Gosssalary);
                }
                decimal          PreviousGrossSalary = 0;
                HRM_DESIGNATIONS _Desobj             = objDeg_BLL.GetDesignationIdByDesNameGradAndGoss(desName, grade, Gosssalary);
                if (_Desobj != null)
                {
                    int regID_TO     = Convert.ToInt32(ddlRegion_TR.SelectedValue);
                    int ofcID_TO     = Convert.ToInt32(ddlOffice_TR.SelectedValue);
                    int deptID_TO    = Convert.ToInt32(ddlDepartment_TR.SelectedValue);
                    int sectionID_TO = Convert.ToInt32(ddlSection_TR.SelectedValue);
                    int subSecID_TO  = Convert.ToInt32(ddlSubSec_TR.SelectedValue);
                    //-------------------From-------------------------------
                    objTrns.Regions_ID_FROM = Convert.ToInt32(lblRegion_TRNS.Text);
                    objTrns.Office_ID_FROM  = Convert.ToInt32(lblOffice_TRNS.Text);
                    objTrns.DPT_ID_FROM     = Convert.ToInt32(lblDepartment_TRNS.Text);
                    objTrns.SEC_ID_FROM     = Convert.ToInt32(lblSection_TRNS.Text);
                    objTrns.SUB_SEC_ID_FROM = Convert.ToInt32(lblSubSection_TRNS.Text);
                    objTrns.DEG_ID_FROM     = Convert.ToInt32(lblDesignation_TRNS.Text);
                    objTrns.GrossSalaryFrom = Convert.ToDecimal(lblStepGrossSalary.Text);
                    objTrns.GradeFrom       = lblGrade_TRNS.Text;
                    PreviousGrossSalary     = Convert.ToDecimal(objTrns.GrossSalaryFrom);
                    //-------------------to-------------------------------
                    objTrns.Regions_ID_TO = regID_TO;
                    objTrns.Office_ID_TO  = ofcID_TO;
                    objTrns.DPT_ID_TO     = deptID_TO;
                    objTrns.SEC_ID_TO     = sectionID_TO;
                    objTrns.SUB_SEC_ID_TO = subSecID_TO;
                    objTrns.DEG_ID_TO     = _Desobj.DEG_ID;
                    objTrns.GradeTo       = _Desobj.GRADE;
                    objTrns.GorssSalaryTo = _Desobj.GROSS_SAL;
                    objTrns.Status        = hidTransferStatus.Value.ToString();
                    objTrns.EID           = employeeID;

                    objTrns.TRANSFER_DATE = DateTime.Now.Date;
                    objTrns.EDIT_USER     = ((SessionUser)Session["SessionUser"]).UserId;
                    objTrns.EDIT_DATE     = DateTime.Now;
                    objTrns.OCODE         = ((SessionUser)Session["SessionUser"]).OCode;
                }

                int result = objAdm_BLL.SaveEmployee_Transfer(objTrns, employeeID, PreviousGrossSalary);
                if (result == 1)
                {
                    BindGridEmployeeTransfer();
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Save Successfully')", true);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }