Beispiel #1
0
        public ActionResult PendingDeposite(string key = "")
        {
            /*if (MessageBox.Show("Are You Sure ?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.No)
             *  return RedirectToAction("Index", "Admin");*/
            var result = DepositeRepo.GetAllPendingDeposite(key);

            return(View(result));
        }
Beispiel #2
0
        public ActionResult AcceptPendingAgentDeposite(int pendingAgentId)
        {
            if (MessageBox.Show("Are You Sure ?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return(RedirectToAction("PendingDeposite"));
            }

            var result = DepositeRepo.AcceptByAdmin(pendingAgentId);

            if (result.HasError)
            {
                ViewBag.Error = result.Message;
                return(RedirectToAction("PendingDeposite"));
            }
            return(RedirectToAction("PendingDeposite"));
        }
        public ActionResult DepositRequest(DepositeModel model, HttpPostedFileBase image1)
        {
            /*if (!ModelState.IsValid)
             * {
             *  return View(model);
             * }*/

            if (image1 != null)
            {
                model.ReceiptImage = new byte[image1.ContentLength];
                image1.InputStream.Read(model.ReceiptImage, 0, image1.ContentLength);
            }

            var deposite = new Deposite()
            {
                DType         = model.DType,
                ChequeNo      = model.ChequeNo,
                RefNum        = model.RefNum,
                ChequeBank    = model.ChequeBank,
                Amount        = model.Amount,
                Date          = model.Date,
                BankId        = model.BankId,
                ReceiptImage  = model.ReceiptImage,
                UserID        = HttpUtil.Current.ID,
                AdminVerifyId = (int)EnumCollection.AdminVarifyEnum.NotAccept
            };

            var result = DepositeRepo.Save(deposite);

            if (result.HasError == true)
            {
                ViewBag.Error = result.Message;
                return(View(model));
            }
            //Context.Deposites.Add(deposite);
            //Context.SaveChanges();
            ViewBag.Success = "Your Deposite is send to Admin for Verify";
            return(View());
        }