Ejemplo n.º 1
0
 public void Delete(VariablePaymentHeader entity)
 {
     try
     {
         variablepaymentheaderrepository.Delete(entity);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 public void Add(VariablePaymentHeader input)
 {
     try
     {
         input.CreatedBy = sessionObj.USERID;
         input.CreatedOn = UTILITY.SINGAPORETIME;
         variablepaymentheaderrepository.Add(input);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
        public JsonResult EditVariablePay(int Employeeid, int Month, int Year)
        {
            var structurelist = salarystructureheaderBo
                                .GetListByProperty(x => x.EmployeeId == Employeeid)
                                .ToList();

            if (structurelist != null && structurelist.Count > 0)
            {
                var structureID = salarystructureheaderBo
                                  .GetByProperty(x => x.EmployeeId == Employeeid && x.IsActive == true)
                                  .StructureID;
                var ComponentsList = salarystructuredetailBo
                                     .GetListByProperty(x => x.StructureID == structureID && x.IsActive == true && x.IsVariablePay == true)
                                     .ToList();

                VariablePaymentHeader vpHeader = variablepaymentheaderBo.GetAll().Where(x => x.BranchID == BRANCHID && x.Month == Month && x.Year == Year).FirstOrDefault();

                List <VariablePaymentDetail> vpDetails = new List <VariablePaymentDetail>();
                if (vpHeader != null)
                {
                    vpDetails = variabledetailBo.GetAll().Where(x => x.HeaderId == vpHeader.HeaderID && x.EmployeeId == Employeeid).ToList();
                }

                var variablepaymentdetailList = new List <VariablePaymentDetail>();

                foreach (var item in ComponentsList)
                {
                    VariablePaymentDetail vpDtl = vpDetails.Where(x => x.ComponentCode == item.Code).FirstOrDefault();
                    var variablepaymentdetail   = new VariablePaymentDetail()
                    {
                        Amount        = vpDtl != null ? vpDtl.Amount : item.Amount,
                        ComponentCode = item.Code,
                        EmployeeId    = salarystructureheaderBo
                                        .GetByProperty(x => x.StructureID == item.StructureID)
                                        .EmployeeId,
                    };

                    variablepaymentdetailList.Add(variablepaymentdetail);
                }

                return(Json(variablepaymentdetailList, JsonRequestBehavior.AllowGet));
            }

            return(Json(new { }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        public ActionResult SaveVariablePaytransaction(UpdateVariablePayVm updatevariablepay)
        {
            VariablePaymentHeader vpHeader = variablepaymentheaderBo.GetAll().Where(x => x.BranchID == BRANCHID && x.Month == updatevariablepay.variablepaymentheader.Month && x.Year == updatevariablepay.variablepaymentheader.Year).FirstOrDefault();

            if (vpHeader != null)
            {
                //variablepaymentheaderBo.Delete(vpHeader);
                List <VariablePaymentDetail> vpDetails = variabledetailBo.GetAll().Where(x => x.HeaderId == vpHeader.HeaderID && x.EmployeeId == updatevariablepay.variablepaymentdetail[0].EmployeeId).ToList();
                for (var i = 0; i < vpDetails.Count; i++)
                {
                    VariablePaymentDetail vpDtl = variabledetailBo.GetById(vpDetails[i].DetailID);
                    variabledetailBo.Delete(vpDtl);
                }
            }

            VariablePaymentHeader variablepaymentheader = new VariablePaymentHeader()
            {
                HeaderID      = vpHeader != null ? vpHeader.HeaderID : 0,
                TransactionNo = updatevariablepay.variablepaymentheader.TransactionNo,
                Month         = updatevariablepay.variablepaymentheader.Month,
                Year          = updatevariablepay.variablepaymentheader.Year,
                BranchID      = BRANCHID,
                Status        = true,
            };

            variablepaymentheaderBo.Add(variablepaymentheader);
            if (updatevariablepay.variablepaymentdetail != null && updatevariablepay.variablepaymentdetail.Count() > 0)
            {
                for (var i = 0; i < updatevariablepay.variablepaymentdetail.Count; i++)
                {
                    VariablePaymentDetail variabledetail = new VariablePaymentDetail()
                    {
                        HeaderId      = variablepaymentheader.HeaderID,
                        Amount        = updatevariablepay.variablepaymentdetail[i].Amount,
                        ComponentCode = updatevariablepay.variablepaymentdetail[i].ComponentCode,
                        EmployeeId    = updatevariablepay.variablepaymentdetail[i].EmployeeId
                    };
                    variabledetailBo.Add(variabledetail);
                }
            }
            return(RedirectToAction("UpdateVariablePay"));
        }