public JsonResult CreateBill(string Customer_Phone) { Dictionary <int, Item> order = (Dictionary <int, Item>)Session["order"]; double sum = 0; foreach (var item in order) { sum += item.Value.product.price * item.Value.quantity; } if (sum != 0) { OrderAction.Create_Order(DateTime.Now.Date, (string)Session["id"], sum); int ID_Order = OrderAction.Find(); foreach (var item in order) { BillAction.Create_Bill(ID_Order, item.Value.product.id, item.Value.quantity, item.Value.product.price); } if (!Customer_Phone.Equals("0") || Customer_Phone != "") { MemberShipAction.Increate_Score(Customer_Phone, order.Count * 2); } Session["order"] = null; order.Clear(); ID_Order = 0; sum = 0; return(Json("Good", JsonRequestBehavior.AllowGet)); } else { Session["order"] = null; order.Clear(); sum = 0; return(Json("Bad", JsonRequestBehavior.AllowGet)); } }
public bool SendConfirmationEmail(MemberShipAction neworupgrade) { if (MemberShipAction.SendingEmailforNewuser == neworupgrade) { return(true); // Implement New user upgrade email } else { return(true); // Implement update user upgrade email } }
public ActionResult MemberLogin(string Phone) { var member = MemberShipAction.Find_MemberShip_By_Phone(Phone); if (member != null) { Session["member_id"] = member.phone_number; Session["name"] = member.fullname; return(Redirect("~/Home/HomePage")); } return(Redirect("~/Home/HomePage")); }
public ActionResult Book_Table(int ID_Table) { ReservationAction.Auto_Cancel(); string phone = (string)Session["member_id"]; if (MemberShipAction.Find_MemberShip_By_Phone(phone).score >= 10) { ReservationAction.Create_Reservation(phone, ID_Table); TableAction.Delete_Table(ID_Table); return(Redirect("~/Home/HomePage")); } return(View()); }
public ActionResult MemberInformation() { if (Session["name"] != null) { var id = (string)Session["member_id"]; ViewBag.Customer = MemberShipAction.Find_MemberShip_By_Phone(id); ViewBag.Reservation = ReservationAction.Get_Reservation_By_Phone(id); ViewBag.History = ReservationAction.Get_History_Reservation(id); return(View()); } else { return(Redirect("~/Home/HomePage")); } }
public ActionResult Cancel_By_Customer(int ID_Reservation) { ReservationAction.Auto_Cancel(); using (var db = new DBConnection()) { var reservation = db.DbReservation.Find(ID_Reservation); if (reservation.cancel == false && reservation.checkin == false) { ReservationAction.Cancel_Reservation((string)Session["member_id"], ID_Reservation); } else { if (reservation.seats == 5) { MemberShipAction.Decreate_Score((string)Session["member_id"], 10); } if (reservation.seats == 10) { MemberShipAction.Decreate_Score((string)Session["member_id"], 15); } } return(Redirect("~/Account/MemberInformation")); } }
public JsonResult GetListMemberShip(int page) { return(Json(MemberShipAction.Get_All_MemberShip(10, page), JsonRequestBehavior.AllowGet)); }
public ActionResult CreateMemberShip(string Phone, string FullName, string Gender, string Address) { MemberShipAction.Create_MemberShip(Phone, FullName, Gender, Address); return(Redirect("~/Home/HomePage")); }