Beispiel #1
0
        public string GetExpenseDetailsByID(string ID)
        {
            try
            {
                OtherExpenseViewModel otherExpenseViewModel = Mapper.Map <OtherExpense, OtherExpenseViewModel>(_otherExpenseBusiness.GetOtherExpenseByID(Guid.Parse(ID)));
                if (otherExpenseViewModel != null)
                {
                    otherExpenseViewModel.creditAmountFormatted = _commonBusiness.ConvertCurrency(otherExpenseViewModel.Amount, 2);
                    otherExpenseViewModel.AccountCode           = otherExpenseViewModel.AccountCode + ":" + otherExpenseViewModel.chartOfAccountsObj.ISEmploy;
                }

                return(JsonConvert.SerializeObject(new { Result = "OK", Record = otherExpenseViewModel }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
Beispiel #2
0
 public string GetOtherExpenseByIDForMobile(OtherExpense otherExpenseObj)
 {
     try
     {
         if (otherExpenseObj.ID != Guid.Empty && otherExpenseObj.ID != null)
         {
             OtherExpenseViewModel expenseObj = Mapper.Map <OtherExpense, OtherExpenseViewModel>(_otherExpenseBusiness.GetOtherExpenseByID(otherExpenseObj.ID));
             return(JsonConvert.SerializeObject(new { Result = true, Records = expenseObj }));
         }
         else
         {
             throw new Exception("Invalid Input");
         }
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new { Result = false, Message = ex.Message }));
     }
 }