public ActionResult Edit(int Id, MakePaymentModel model)
        {
            var ts = SessionStore.GetTravelSession();;

            model.AgentId     = ts.LoginTypeId;
            model.UpdatedBy   = ts.AppUserId;
            model.UpdatedDate = DateTime.UtcNow;
            model.CreatedBy   = ts.AppUserId;

            model.DepositId = Id;

            MakePaymentModel m = new MakePaymentModel();

            ViewData["Bank"]              = new SelectList(ser.AllBank(), "BankId", "BankName");
            ViewData["BankBranch"]        = new SelectList(ser.AllBankBranch(model.BankId), "BankBranchId", "BranchName");
            ViewData["ChequeDrawnOnBank"] = new SelectList(ser.GetBank(), "BankId", "BankName");
            model.SalesAgentList          = ser.GetAllGetSalesAgentList();

            m = ser.GetBranchDistributroPaymentDetail(Id);

            model.flag = "DistributorMakePayment";

            if (model.rdbPaymentMode.ToString() == "Cash")
            {
                model.PaymentModeId = 1;
                ser.BranchCashEdit(model);
            }
            if (model.rdbPaymentMode.ToString() == "Cheque")
            {
                model.PaymentModeId = 2;
                ser.BranchChequeEdit(model);
            }
            if (model.rdbPaymentMode.ToString() == "Draft")
            {
                model.PaymentModeId = 3;
                ser.BranchDraftEdit(model);
            }

            if (model.rdbPaymentMode.ToString() == "BankTransfer")
            {
                model.PaymentModeId = 4;
                ser.BranchBankTransferEdit(model);
            }
            if (model.rdbPaymentMode.ToString() == "RTGS")
            {
                model.PaymentModeId = 5;
                ser.BranchRTGSEdit(model);
            }
            if (model.rdbPaymentMode.ToString() == "CashGivenTo")
            {
                model.PaymentModeId = 6;
                ser.BranchCashGivenToEdit(model);
            }

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult Edit(int Id, MakePaymentModel model)
        {
            var ts = (TravelSession)Session["TravelPortalSessionInfo"];

            model.DepositId = Id;
            model.UpdatedBy = ts.AppUserId;

            MakePaymentModel m = new MakePaymentModel();

            ViewData["Bank"]              = new SelectList(ser.AllBank(), "BankId", "BankName");
            ViewData["BankBranch"]        = new SelectList(ser.AllBankBranch(model.BankId), "BankBranchId", "BranchName");
            ViewData["ChequeDrawnOnBank"] = new SelectList(ser.GetBank(), "BankId", "BankName");
            model.SalesAgentList          = ser.GetAllGetSalesAgentList();
            model.AgentList                = new CreditLimitProvider().GetAllBranchDistributorList(ts.LoginTypeId);
            model.ChequeCurrencyList       = new SelectList(ser.GetCurrenciesList(), "Value", "Text");
            model.DraftCurrencyList        = new SelectList(ser.GetCurrenciesList(), "Value", "Text");
            model.CashCurrencyList         = new SelectList(ser.GetCurrenciesList(), "Value", "Text");
            model.BankTransferCurrencyList = new SelectList(ser.GetCurrenciesList(), "Value", "Text");
            model.RTGSCurrencyList         = new SelectList(ser.GetCurrenciesList(), "Value", "Text");
            model.CashGivenToCurrencyList  = new SelectList(ser.GetCurrenciesList(), "Value", "Text");

            m = ser.GetBranchDistributroPaymentDetail(Id);

            try
            {
                if (model.rdbPaymentMode.ToString() == "Cash")
                {
                    model.PaymentModeId = 1;
                    ser.BranchCashEdit(model);
                    ser.ApproveUnapprovedBranchDistributorMakePayment((int)Id, model.UpdatedBy);
                }
                if (model.rdbPaymentMode.ToString() == "Cheque")
                {
                    model.PaymentModeId = 2;
                    ser.BranchChequeEdit(model);
                    ser.ApproveUnapprovedBranchDistributorMakePayment((int)Id, model.UpdatedBy);
                }
                if (model.rdbPaymentMode.ToString() == "Draft")
                {
                    model.PaymentModeId = 3;
                    ser.BranchDraftEdit(model);
                    ser.ApproveUnapprovedBranchDistributorMakePayment((int)Id, model.UpdatedBy);
                }

                if (model.rdbPaymentMode.ToString() == "BankTransfer")
                {
                    model.PaymentModeId = 4;
                    ser.BranchBankTransferEdit(model);
                    ser.ApproveUnapprovedBranchDistributorMakePayment((int)Id, model.UpdatedBy);
                }
                if (model.rdbPaymentMode.ToString() == "RTGS")
                {
                    model.PaymentModeId = 5;
                    ser.BranchRTGSEdit(model);
                    ser.ApproveUnapprovedBranchDistributorMakePayment((int)Id, model.UpdatedBy);
                }
                if (model.rdbPaymentMode.ToString() == "CashGivenTo")
                {
                    model.PaymentModeId = 6;
                    ser.BranchCashGivenToEdit(model);
                    ser.ApproveUnapprovedBranchDistributorMakePayment((int)Id, model.UpdatedBy);
                }
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                TempData["ActionResponse"] = ex.Message;
                return(RedirectToAction("Edit", new { @Id = Id }));
            }
        }