public void Clear_Payment_Form() { Calendar1.SelectedDate = DateTime.UtcNow; Payment_Type.ClearSelection(); Payment_Amount.Text = ""; Payment_Success_message.Text = ""; }
public void Prepare_Order_Form() { MySqlConnection dbconn = new MySqlConnection(CommonClass.connectionstring); dbconn.Open(); Populate_Products(dbconn); Show_Active_Promotion(dbconn); AddressBook1.Load_Address(dbconn, true); //AddressBook1.Load_Address(dbconn); if (Store_Place_Holder.Visible == false) { PAYMENT_TYPE_ID.Value = WalletPaymentType; ORDER_STATUS.Value = "Open"; } Payment_Received_Flag.ClearSelection(); Payment_Type.ClearSelection(); Delivery_Method.ClearSelection(); Calculate_Grand_Total(); Payment_Received_Information.Visible = false; PaymentControl1.Prepare_Payment_Form(dbconn); PaymentControl1.Clear_Cheque_Details(); dbconn.Close(); if (OrderLoad != null) { OrderLoad(this, EventArgs.Empty); } }
public ActionResult DeleteConfirmed(int id) { Payment_Type payment_Type = db.Payment_Type.Find(id); db.Payment_Type.Remove(payment_Type); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PaymentType_ID,PaymentType_Name,PaymentType_Description")] Payment_Type payment_Type) { if (ModelState.IsValid) { db.Entry(payment_Type).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(payment_Type)); }
public ActionResult Create([Bind(Include = "PaymentType_ID,PaymentType_Name,PaymentType_Description")] Payment_Type payment_Type) { if (ModelState.IsValid) { db.Payment_Type.Add(payment_Type); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(payment_Type)); }
// GET: Payment_Type/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Payment_Type payment_Type = db.Payment_Type.Find(id); if (payment_Type == null) { return(HttpNotFound()); } return(View(payment_Type)); }
public object makeOrderPayment(int customerorderID, float payAmount, int paymentTypeID) { db.Configuration.ProxyCreationEnabled = false; dynamic toReturn = new ExpandoObject(); try { Customer_Order customerorder = db.Customer_Order.Where(x => x.CustomerOrderID == customerorderID).FirstOrDefault(); if (customerorder != null) { if (customerorder.CustomerOrderStatusID != null) { Payment_Type paymentType = db.Payment_Type.Where(x => x.PaymentTypeID == paymentTypeID).FirstOrDefault(); if (paymentType != null) { Payment payment = new Payment(); payment.CustomerOrderID = customerorder.CustomerOrderID; payment.Customer_Order = customerorder; payment.PayAmount = payAmount; payment.PayDate = DateTime.Now; payment.PaymentTypeID = paymentTypeID; db.Payments.Add(payment); db.SaveChanges(); toReturn.Payment = db.Payments.ToList().LastOrDefault(); } else { toReturn.Error = "Payment Type Not Found"; } } else { toReturn.Error = "Order isn't elgible for payment."; } } else { toReturn.Error = "Order Not Found"; } } catch { toReturn.Error = "Payment Add Unsuccessful"; } return(toReturn); }
public object deletePaymentTypes(int id) { db.Configuration.ProxyCreationEnabled = false; dynamic toReturn = new ExpandoObject(); try { Payment_Type newType = db.Payment_Type.Where(x => x.PaymentTypeID == id).FirstOrDefault(); db.Payment_Type.Remove(newType); db.SaveChanges(); toReturn.Message = "Payment Type Delete Successful"; } catch { toReturn.Error = "Payment Type Delete Unsuccessful"; } return(toReturn); }
public object updatePaymentTypes(int id, string description) { db.Configuration.ProxyCreationEnabled = false; dynamic toReturn = new ExpandoObject(); try { Payment_Type newType = db.Payment_Type.Where(x => x.PaymentTypeID == id).FirstOrDefault(); newType.PTDescription = description; db.SaveChanges(); toReturn.Message = "Update Payment Type Successful"; } catch { toReturn.Error = "Payment Type Update Unsuccessful"; } return(toReturn); }
public object makeSalePayment(int saleID, float payAmount, int paymentTypeID) { db.Configuration.ProxyCreationEnabled = false; dynamic toReturn = new ExpandoObject(); try { Sale sale = db.Sales.Where(x => x.SaleID == saleID).FirstOrDefault(); if (sale != null) { Payment_Type paymentType = db.Payment_Type.Where(x => x.PaymentTypeID == paymentTypeID).FirstOrDefault(); if (paymentType != null) { Payment payment = new Payment(); payment.SaleID = sale.SaleID; payment.Sale = sale; payment.PayAmount = payAmount; payment.PayDate = DateTime.Now; payment.PaymentTypeID = paymentTypeID; db.Payments.Add(payment); db.SaveChanges(); toReturn.Payment = db.Payments.ToList().LastOrDefault(); } else { toReturn.Error = "Payment Type Not Found"; } } else { toReturn.Error = "Sale Not Found"; } } catch { toReturn.Error = "Payment Add Unsuccessful"; } return(toReturn); }
public object addPaymentTypes(string description) { db.Configuration.ProxyCreationEnabled = false; dynamic toReturn = new ExpandoObject(); try { Payment_Type newType = new Payment_Type(); newType.PTDescription = description; db.Payment_Type.Add(newType); db.SaveChanges(); toReturn.Message = "Payment Type Added Successfully"; } catch { toReturn.Error = "Payment Type Add Unsuccessful"; } return(toReturn); }