Exemplo n.º 1
0
        public string InsertSalaryIncrement(InsertSalaryIncrement obj)
        {
            string returnResult = (dynamic)null;

            try
            {
                if (obj != null)
                {
                    if (obj.SalaryIncrements != null)
                    {
                        var SalaryIncrements = new InsertSalaryIncrement_SalaryIncrements()
                        {
                            StaffId         = obj.SalaryIncrements.StaffId,
                            DesigignationId = obj.SalaryIncrements.DesigignationId,
                            PayScalesId     = obj.SalaryIncrements.PayScalesId,
                            Date            = obj.SalaryIncrements.Date,
                            Amount          = obj.SalaryIncrements.Amount
                        };
                        _SalaryIncrementsRepo.Insert(SalaryIncrements);
                        returnResult = "Saved";
                    }
                }
            }
            catch (Exception ex)
            {
                returnResult = "ERROR102:ClassesServ/InsertClassessList - " + ex.Message;
            }
            return(returnResult);
        }
        public async Task <IActionResult> InsertSalaryIncrement(IndexSalaryIncrementsListVM obj)
        {
            try
            {
                if (obj.SalaryIncrements != null)
                {
                    var SalaryIncrements = new InsertSalaryIncrement_SalaryIncrements()
                    {
                        StaffId         = obj.SalaryIncrements.StaffId,
                        DesigignationId = obj.SalaryIncrements.DesigignationId,
                        PayScalesId     = obj.SalaryIncrements.PayScalesId,
                        Date            = obj.SalaryIncrements.Date,
                        Amount          = obj.SalaryIncrements.Amount
                    };

                    var model = new InsertSalaryIncrement()
                    {
                        SalaryIncrements = SalaryIncrements
                    };

                    await Task.Run(() => _SalaryIncrementsServ.InsertSalaryIncrement(model));
                }
            }
            catch (Exception)
            {
                return(BadRequest());
            }
            return(RedirectToAction("SalaryIncrementsList"));
        }