Beispiel #1
0
        protected void imgbtnPFContributionEdit_Click(object sender, EventArgs e)
        {
            PFContributionBLL   _pfcontributionbll  = new PFContributionBLL();
            HRM_PFConfiguration _txtPfConfiguration = new HRM_PFConfiguration();
            ImageButton         imgbtn = (ImageButton)sender;
            GridViewRow         row    = (GridViewRow)imgbtn.NamingContainer;

            try
            {
                string txtbcContributionID = "";
                Label  lblTaxType          = (Label)grdviewPFContribution.Rows[row.RowIndex].FindControl("lblPfContribution");
                if (lblTaxType != null)
                {
                    string OCODE = ((SessionUser)Session["SessionUser"]).OCode;
                    txtbcContributionID = lblTaxType.Text;
                    _txtPfConfiguration = _pfcontributionbll.getPFContributionByIDandocode(txtbcContributionID, OCODE);

                    if (_txtPfConfiguration != null)
                    {
                        txtbcPfEmployeeContribution.Text = _txtPfConfiguration.PFEmployee.ToString();
                        txtOwnerContribution.Text        = _txtPfConfiguration.OwnerContribution.ToString();
                        hidPFID.Value           = _txtPfConfiguration.PFContributionID.ToString();
                        btnLeaveTypeSubmit.Text = "Update";
                    }
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }
Beispiel #2
0
        internal int UpdatePFContribution(HRM_PFConfiguration _hrmPfcontrinbution)
        {
            HRM_PFConfiguration obj = _context.HRM_PFConfiguration.First(x => x.PFContributionID == _hrmPfcontrinbution.PFContributionID);

            obj.OwnerContribution = _hrmPfcontrinbution.OwnerContribution;
            obj.PFEmployee        = _hrmPfcontrinbution.PFEmployee;
            obj.EDIT_USER         = _hrmPfcontrinbution.EDIT_USER;
            obj.EDIT_DATE         = _hrmPfcontrinbution.EDIT_DATE;
            _context.SaveChanges();
            return(1);
        }
Beispiel #3
0
        protected void btnPFContributonSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                HRM_PFConfiguration _hrmPfcontrinbution = new HRM_PFConfiguration();
                PFContributionBLL   _pfcontributionbll  = new PFContributionBLL();
                _hrmPfcontrinbution.OwnerContribution = Convert.ToDouble(txtbcPfEmployeeContribution.Text);
                _hrmPfcontrinbution.PFEmployee        = Convert.ToDouble(txtOwnerContribution.Text);
                _hrmPfcontrinbution.EDIT_USER         = ((SessionUser)Session["SessionUser"]).UserId;
                _hrmPfcontrinbution.EDIT_DATE         = DateTime.Now;
                _hrmPfcontrinbution.OCODE             = ((SessionUser)Session["SessionUser"]).OCode;

                if (btnLeaveTypeSubmit.Text == "Submit")
                {
                    int result = _pfcontributionbll.SavePFContribution(_hrmPfcontrinbution);
                    if (result == 1)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Save Successfully')", true);
                    }
                }
                else
                {
                    _hrmPfcontrinbution.PFContributionID = Convert.ToInt16(hidPFID.Value);
                    int result = _pfcontributionbll.UpdatePFContribution(_hrmPfcontrinbution);
                    if (result == 1)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Update Successfully')", true);
                    }
                }
                GetPFContributionList();
                ClearController();
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true);
            }
        }
 internal int UpdatePFContribution(HRM_PFConfiguration _hrmPfcontrinbution)
 {
     return(_pfContributionDal.UpdatePFContribution(_hrmPfcontrinbution));
 }
Beispiel #5
0
 internal int SavePFContribution(HRM_PFConfiguration _hrmPfcontrinbution)
 {
     _context.HRM_PFConfiguration.AddObject(_hrmPfcontrinbution);
     _context.SaveChanges();
     return(1);
 }