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

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

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

            try
            {
                if (obj != null)
                {
                    //[Note: insert 'states' table]
                    if (obj.FeeTypes != null)
                    {
                        var FeeTypes = new InsertFeeType_FeeTypes()
                        {
                            ClassId  = obj.FeeTypes.ClassId,
                            Name     = obj.FeeTypes.Name,
                            IsActive = obj.FeeTypes.IsActive
                        };

                        _FeeTypesRepo.Insert(FeeTypes);
                        returnResult = "Saved";
                    }
                }
            }
            catch (Exception ex)
            {
                returnResult = "ERROR102:ClassesServ/InsertClassessList - " + ex.Message;
            }

            return(returnResult);
        }