Beispiel #1
0
        public JsonResult GetCharges(ChargesViewModel cViewModel)
        {
            PaginationInfo pager = new PaginationInfo();

            pager = cViewModel.Pager;

            PaginationViewModel pViewModel = new PaginationViewModel();

            try
            {
                pViewModel.dt = _cRepo.GetCharges(cViewModel.Charges.ChargesName, cViewModel.Charges.Abbreviation, ref pager);

                pViewModel.Pager = pager;

                Logger.Debug("Charges Controller GetCharges");
            }

            catch (Exception ex)
            {
                cViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("Charges Controller - GetCharges" + ex.ToString());
            }

            return(Json(JsonConvert.SerializeObject(pViewModel), JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        void switcherForCharges_Toggled(object sender, ToggledEventArgs e)
        {
            var swit = (Switch)sender;
            ChargesViewModel group = null;

            if (swit.BindingContext != null)
            {
                group = (ChargesViewModel)swit.BindingContext;
            }
            if (group != null)
            {
                if (swit.IsToggled == true)
                {
                    totalAmount = Math.Round(totalAmount + group.Balance, 2);
                    GroupChargeSelected.Text = totalAmount.ToString();
                }
                else
                {
                    if (Math.Round(totalAmount - group.Balance, 2) >= 0)
                    {
                        totalAmount = Math.Round(totalAmount - group.Balance, 2);
                    }
                    GroupChargeSelected.Text = totalAmount.ToString();
                }
            }
        }
Beispiel #3
0
 public async Task ShowChargesAsync()
 {
     await this.ViewService.ExecuteBusyActionAsync(
         async() =>
     {
         ChargesViewModel chargesViewModel = new ChargesViewModel();
         await chargesViewModel.LoadChargesAsync();
         this.CurrentViewModel = chargesViewModel;
     });
 }
Beispiel #4
0
        public JsonResult CheckChargesAbbrevationExist(string chargesabbr)
        {
            bool check = false;

            ChargesViewModel cViewModel = new ChargesViewModel();

            try
            {
                check = _cRepo.CheckChargesAbbrevationExist(chargesabbr);

                Logger.Debug("Charges Controller CheckChargesAbbrevationExist");
            }
            catch (Exception ex)
            {
                Logger.Error("Charges Controller - CheckChargesAbbrevationExist" + ex.Message);
            }

            return(Json(check, JsonRequestBehavior.AllowGet));
        }
Beispiel #5
0
        private void OnCurrentViewTypeChanged()
        {
            switch (CurrentViewType)
            {
            case ReportsSubviewType.SavedReports:
            case ReportsSubviewType.PendingReports:
            case ReportsSubviewType.PastReports:
                CurrentViewModel = new ExpenseReportsViewModel();
                break;

            case ReportsSubviewType.ApprovalsReports:
                CurrentViewModel = new ApproveExpenseReportsViewModel();
                break;

            case ReportsSubviewType.OutgoingCharges:
                CurrentViewModel = new ChargesViewModel();
                break;
            }
        }
Beispiel #6
0
        public JsonResult Update(ChargesViewModel cViewModel)
        {
            try
            {
                Set_Date_Session(cViewModel.Charges);

                _cRepo.Update(cViewModel.Charges);

                cViewModel.FriendlyMessage.Add(MessageStore.Get("Cr02"));

                Logger.Debug("Charges Controller Update");
            }
            catch (Exception ex)
            {
                cViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("Charges Controller - Update  " + ex.Message);
            }

            return(Json(cViewModel));
        }
Beispiel #7
0
        public JsonResult Insert(ChargesViewModel cViewModel)
        {
            try
            {
                Set_Date_Session(cViewModel.Charges);

                cViewModel.Charges.ChargesId = _cRepo.Insert(cViewModel.Charges);

                cViewModel.FriendlyMessage.Add(MessageStore.Get("Cr01"));

                Logger.Debug("Charges Controller Insert");
            }
            catch (Exception ex)
            {
                cViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("Charges Controller - Insert " + ex.Message);
            }

            return(Json(cViewModel));
        }
Beispiel #8
0
 public ActionResult Index(ChargesViewModel cViewModel)
 {
     return(View(cViewModel));
 }