Exemple #1
0
        public string SendNotification(OtherExpenseViewModel otherExpenseVM)
        {
            try
            {
                AppUA appUA = Session["AppUA"] as AppUA;
                SPAccounts.DataAccessObject.DTO.Common common = new SPAccounts.DataAccessObject.DTO.Common();
                otherExpenseVM.commonObj             = new CommonViewModel();
                otherExpenseVM.commonObj.UpdatedBy   = appUA.UserName;
                otherExpenseVM.commonObj.UpdatedDate = common.GetCurrentDateTime();
                bool result = _otherExpenseBusiness.NotifyOtherExpense(otherExpenseVM.ID);

                string  titleString       = "Expense Approval";
                string  descriptionString = otherExpenseVM.RefNo + ", Expense: " + otherExpenseVM.AccountCode + ", Amount: " + otherExpenseVM.Amount + ", Notes: " + otherExpenseVM.Description;
                Boolean isCommon          = true;
                string  customerID        = "";
                _commonBusiness.SendToFCM(titleString, descriptionString, isCommon, customerID);
                return(JsonConvert.SerializeObject(new { Result = "OK", Message = (result ? c.NotificationSuccess : "Failed") }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }