예제 #1
0
 public static Boolean UpdatePayment(PaymentClass payment)
 {
     Boolean flag = false;
     try
     {
         IUpdate objinter = new BALPayment();
         flag = objinter.UpdateRecord(payment);
     }
     catch (Exception ex)
     {
         throw;
     }
     return flag;
 }
예제 #2
0
 public static Boolean CreatePayment(PaymentClass payment)
 {
     Boolean flag = false;
     try
     {
         IRecordInsert objtext = new BALPayment();
         flag = objtext.AddRecord(payment);
     }
     catch (Exception ex)
     {
         throw;
     }
     return flag;
 }
예제 #3
0
        //public ActionResult Edit()
        //{
        //    if (Session["Login"] != null)
        //    {
        //        LoginSession loginsession = (LoginSession)Session["Login"];
        //        IEnumerable<DAL.PaymentList> List = null;
        //        DateTime Dt = DateTime.Now.Date;
        //        if ((Request.QueryString["consumerTypeID"] != null) && (Request.QueryString["consumer"] != null) && (Request.QueryString["PayDate"] != null) && (Request.QueryString["PaymentID"] != null) && (Request.QueryString["consumerTypeID"] != "") && (Request.QueryString["consumer"] != "") && (Request.QueryString["PayDate"] != "") && (Request.QueryString["PaymentID"] != ""))
        //        {
        //            String ConsumerType = Request.QueryString["consumerTypeID"].ToString();
        //            String ConsumerID = Request.QueryString["consumer"].ToString();
        //            String Paymentdate = Request.QueryString["PayDate"].ToString();
        //            String PaymentID = Request.QueryString["PayDate"].ToString();
        //            PaymentClass payment = new PaymentClass();
        //            payment = BAL.PaymentModel.EditPayment(PaymentID);
        //            ViewBag.PayID = payment.PayemtID.ToString();
        //            ViewBag.ConsType = new SelectList(BAL.PaymentModel.ConsumerTypeDropDownList(), "Value", "Text", payment.ConsumerType);
        //            ViewBag.ComsumerID = payment.ConsumerID.ToString();
        //            ViewBag.ComsumerTypeID = payment.ConsumerType.ToString();
        //            ViewBag.paydate = payment.PaymentDate;
        //            ViewBag.ConsType = new SelectList(BAL.PaymentModel.ConsumerTypeDropDownList(), "Value", "Text", ConsumerType);
        //            ViewBag.paydate = Paymentdate;
        //            if (ConsumerType == "2")
        //            {
        //                ViewBag.Consumer = new SelectList(BAL.PaymentModel.ConsumerDropDownList(), "Value", "Text", ConsumerID);
        //            }
        //            if (ConsumerType == "1")
        //            {
        //                ViewBag.Consumer = new SelectList(BAL.PaymentModel.OwnerDropDownList(), "Value", "Text", ConsumerID);
        //            }
        //            List = BAL.PaymentModel.PaymentRecordList(ConsumerType, ConsumerID, Paymentdate);
        //            ViewBag.method = new SelectList(BAL.PaymentModel.PaymentTypeDropDownList(), "Value", "Text", payment.paymentMethod);
        //            ViewBag.PaymentAmount = payment.PaymentAmount;
        //            ViewBag.CheckNo = payment.Cheque;
        //            ViewBag.DepositeTo = payment.DepositeTo;
        //        }
        //        return View(List);
        //    }
        //    else
        //    { return RedirectToAction("Index", "Home"); }
        //}
        public JsonResult UpdatePaymentDetails(String mTypeID, String mConsumerID, String mMethodID, String mAmount, String mPaydate, String mcheque, String mdepositedTo, String mPaymentID)
        {
            if (Session["Login"] != null)
            {
                try
                {
                    LoginSession loginsession = (LoginSession)Session["Login"];
                    String actionName = this.ControllerContext.RouteData.Values["action"].ToString();
                    String controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
                    ViewBag.Menu = BAL.Common.GetActiveMenu(controllerName, BAL.Common.LayoutType(loginsession.UserType));

                    if ( (mPaymentID != "") && (mMethodID != "") && (mAmount != "") && (mPaydate != ""))
                    {
                        PaymentClass paymentlObj = new PaymentClass();
                        paymentlObj.PayemtID = Convert.ToInt64(mPaymentID);
                        //paymentlObj.ConsumerType = Convert.ToInt32(mTypeID);
                      //  paymentlObj.ConsumerID = Convert.ToInt64(mConsumerID);
                        paymentlObj.paymentMethod = mMethodID;
                        paymentlObj.PaymentAmount = mAmount;
                        paymentlObj.PaymentDate = mPaydate;
                        paymentlObj.Cheque = mcheque;
                        paymentlObj.DepositeTo = mdepositedTo;
                        paymentlObj.ModifyBy = Convert.ToInt64(loginsession.UserID);
                        if (BAL.PaymentModel.UpdatePayment(paymentlObj))
                        {
                            return Json(new { Result = "true" }, JsonRequestBehavior.AllowGet);
                        }
                        else
                        { return Json(new { Result = "false" }, JsonRequestBehavior.AllowGet); }
                    }
                }
                catch (Exception ex)
                { return Json(new { Result = "false" }, JsonRequestBehavior.AllowGet); }

            }
            return Json(new { Result = false }, JsonRequestBehavior.AllowGet);
        }
예제 #4
0
        public Object EditRecord(Int64 PaymentID)
        {
            PaymentClass _payment = new PaymentClass();
            try
            {
                Payment payment = DAL.DALPayment.PaymentEdit(Convert.ToInt64(PaymentID));
                _payment.PayemtID = payment.ID;

                if (payment.ConsumerType != null)
                {
                    _payment.ConsumerType = payment.ConsumerType;
                }

                if (payment.ConsumerID != null)
                {
                    _payment.ConsumerID = payment.ConsumerID;
                }

                if (payment.Amount != null)
                {
                    _payment.PaymentAmount = payment.Amount.ToString();
                }

                if (payment.Date != null)
                {
                    _payment.PaymentDate = Common.DateGBString(payment.Date.ToString());

                }

                if (payment.PaymentType != null)
                {
                    _payment.paymentMethod = payment.PaymentType.ToString();

                }

                if (!String.IsNullOrEmpty(payment.ChequeNo))
                {
                    _payment.Cheque = payment.ChequeNo;
                }
                if (!String.IsNullOrEmpty(payment.Deposite))
                {
                    _payment.DepositeTo = payment.Deposite;
                }

            }
            catch (Exception ex)
            {
                throw;
            }
            return _payment;
        }
예제 #5
0
        public ActionResult Edit(String PayID)
        {
            if (Session["Login"] != null)
            {
                LoginSession loginsession = (LoginSession)Session["Login"];
                ViewBag.CompanyLogo = loginsession.CompanyLogo;
                String actionName = this.ControllerContext.RouteData.Values["action"].ToString();
                String controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
                ViewBag.Menu = BAL.Common.GetActiveMenu(controllerName, BAL.Common.LayoutType(loginsession.UserType));

                if (PayID != null)
                {
                    String DecPayID = BAL.Security.URLDecrypt(PayID);
                    if ((DecPayID != "0") && (DecPayID != null))
                    {
                        IEnumerable<DAL.PaymentList> List = null;
                        PaymentClass payment = new PaymentClass();
                        try
                        {
                            payment = BAL.PaymentModel.EditPayment(DecPayID);
                            ViewBag.Payment = DecPayID;
                            ViewBag.ConsType = new SelectList(BAL.PaymentModel.ConsumerTypeDropDownList(), "Value", "Text", payment.ConsumerType);

                            ViewBag.ComsumerID = payment.ConsumerID.ToString();
                            ViewBag.ComsumerTypeID = payment.ConsumerType.ToString();
                            ViewBag.paydate = payment.PaymentDate;
                            if (payment.ConsumerType.ToString().Trim() == "2")
                            {
                                ViewBag.Consumer = new SelectList(BAL.PaymentModel.ConsumerDropDownList(), "Value", "Text", payment.ConsumerID);
                            }
                            if (payment.ConsumerType.ToString().Trim() == "1")
                            {
                                ViewBag.Consumer = new SelectList(BAL.PaymentModel.OwnerDropDownList(), "Value", "Text", payment.ConsumerID);
                            }
                            ViewBag.method = new SelectList(BAL.PaymentModel.PaymentTypeDropDownList(), "Value", "Text", payment.paymentMethod);
                            ViewBag.PaymentAmount = payment.PaymentAmount;
                            ViewBag.CheckNo = payment.Cheque;
                            ViewBag.DepositeTo = payment.DepositeTo;
                            if ((Request.QueryString["consumerTypeID"] != null) && (Request.QueryString["consumer"] != null) && (Request.QueryString["PayDate"] != null) && (Request.QueryString["consumerTypeID"] != "") && (Request.QueryString["consumer"] != "") && (Request.QueryString["PayDate"] != "")  )
                            {
                                String ConsumerType = Request.QueryString["consumerTypeID"].ToString();
                                String ConsumerID = Request.QueryString["consumer"].ToString();
                                String Paymentdate = Request.QueryString["PayDate"].ToString();

                                List = BAL.PaymentModel.PaymentRecordList(ConsumerType, ConsumerID, Paymentdate);
                                ViewBag.paydate = Paymentdate;

                            }

                            else
                            {
                                List = BAL.PaymentModel.PaymentRecordList(payment.ConsumerType.ToString().Trim(), payment.ConsumerID.ToString().Trim(), payment.PaymentDate);

                            }

                        }
                        catch (Exception ex)
                        { return Content(ex.Message); }
                        return View(List);
                    }
                }
                {
                    return RedirectToAction("Index", "Payment");
                }
            }
            else
            { return RedirectToAction("Index", "Home"); }
        }