Beispiel #1
0
        public IActionResult addNewMainAccount([FromBody] npf_mainact value)
        {
            try
            {
                if (mainAccountService.GetMainAccountByCode(value.maincode.Trim()).Result != null)
                {
                    return(Ok(new { responseCode = 400, responseDescription = "Balance Sheet Code already Exist" }));
                }
                value.datecreated = DateTime.Now;
                value.createdby   = User.Identity.Name;
                mainAccountService.AddMainAccount(value);

                return(Ok(new { responseCode = 200, responseDescription = "Created Successfully" }));
            }
            catch (Exception ex) {
                return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
            }
        }
Beispiel #2
0
 public IActionResult updateMainAccount([FromBody] npf_mainact value)
 {
     try{
         if (String.IsNullOrEmpty(value.maincode))
         {
             return(Ok(new { responseCode = 500, responseDescription = "Kindly Supply Main Account Code" }));
         }
         var getbal = mainAccountService.GetMainAccountByCode(value.maincode.Trim()).Result;
         getbal.description          = value.description;
         getbal.subtype              = value.subtype;
         getbal.shortname            = value.shortname;
         getbal.npf_balsheet_bl_code = value.npf_balsheet_bl_code;
         getbal.datecreated          = value.datecreated = DateTime.Now;
         getbal.createdby            = value.createdby = User.Identity.Name;
         mainAccountService.UpdateMainAccount(getbal);
         return(Ok(new { responseCode = 200, responseDescription = "Updated Successfully" }));
     }
     catch (Exception ex) {
         return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
     }
 }
 public void RemoveMainAct(npf_mainact mainact)
 {
     unitOfWork.mainAccount.Remove(mainact);
     unitOfWork.Done();
 }
 public async Task <bool> UpdateMainAccount(npf_mainact npf_Mainact)
 {
     unitOfWork.mainAccount.Update(npf_Mainact);
     return(await unitOfWork.Done());
 }