Exemple #1
0
        public async Task <IActionResult> UpdateFeeType(IndexFeeTypesListVM obj)
        {
            try
            {
                if (obj.FeeTypes != null)
                {
                    var FeeTypes = new UpdateFeeType_FeeTypes()
                    {
                        Id       = obj.FeeTypes.Id,
                        ClassId  = obj.FeeTypes.ClassId,
                        Name     = obj.FeeTypes.Name,
                        IsActive = obj.FeeTypes.IsActive
                    };

                    var model = new UpdateFeeType()
                    {
                        FeeTypes = FeeTypes
                    };

                    await Task.Run(() => _FeeTypesServ.UpdateFeeType(model));
                }
            }
            catch (Exception)
            {
                return(BadRequest());
            }
            return(RedirectToAction("FeeTypesList"));
        }
        public string UpdateFeeType(UpdateFeeType obj)
        {
            string returnResult = (dynamic)null;

            try
            {
                if (obj != null)
                {
                    if (obj.FeeTypes != null)
                    {
                        var currentItem = _FeeTypesRepo.Get(obj.FeeTypes.Id);
                        currentItem.Id       = obj.FeeTypes.Id;
                        currentItem.ClassId  = obj.FeeTypes.ClassId;
                        currentItem.Name     = obj.FeeTypes.Name;
                        currentItem.IsActive = obj.FeeTypes.IsActive;
                        _FeeTypesRepo.Update(currentItem);
                        returnResult = "Saved";
                    }
                }
            }
            catch (Exception ex)
            {
                returnResult = "ERROR102:FeeTypesServ/UpdateFeeTypes - " + ex.Message;
            }

            return(returnResult);
        }