/// <summary> /// 根据id修改订单状态 /// </summary> /// <param name="id"></param> /// <returns></returns> public static void ConfirmDelivery(int id) { using (JANESS_SYSTEM_DBEntities context = new JANESS_SYSTEM_DBEntities()) { TB_ORDER confirm = context.TB_ORDER.FirstOrDefault(t => t.ID == id); confirm.ORDER_STATE = "待评价"; context.SaveChanges(); } }
public TB_ORDER getOrderById(int id) { object[] sqlParams = { new SqlParameter("@N_ID", id) }; TB_ORDER result = context.Database.SqlQuery <TB_ORDER>("Usp_GetOrderById @N_ID", sqlParams).SingleOrDefault(); return(result); }
/// <summary> /// 抢单 /// </summary> /// <param name="id"></param> public static void GrabSingle(int id, int RiderID) { using (JANESS_SYSTEM_DBEntities context = new JANESS_SYSTEM_DBEntities()) { TB_ORDER confirm = context.TB_ORDER.FirstOrDefault(t => t.ID == id); //confirm.ORDER_STATE = "付款待发货"; confirm.ORDER_RIDER_ID = RiderID; context.SaveChanges(); } }
/// <summary> /// 通过订单ID修改订单状态(卖家派送) /// </summary> /// <param name="id"></param> public static void UpdateStateByID(int id) { using (JANESS_SYSTEM_DBEntities context = new JANESS_SYSTEM_DBEntities()) { TB_ORDER category = context.TB_ORDER.FirstOrDefault(t => t.ID == id);//先查找出要修改的对象 if (null != category) { category.ORDER_STATE = "发货待收货";//修改数据 context.SaveChanges(); } } }
public static int AltOrder(TB_ORDER order, int ORDER_NO) { using (JANESS_SYSTEM_DBEntities context = new JANESS_SYSTEM_DBEntities()) { TB_ORDER ord = context.TB_ORDER.FirstOrDefault(t => t.ORDER_NO == order.ORDER_NO); if (null != order) { ord.ORDER_STATE = "完成"; } return(context.SaveChanges()); } }
public static int SubmitOrder(int?id) { using (JANESS_SYSTEM_DBEntities context = new JANESS_SYSTEM_DBEntities()) { TB_ORDER category = context.TB_ORDER.FirstOrDefault(t => t.ORDER_NO == id);//先查找出要修改的对象 if (null != category) { category.ORDER_STATE = "付款待发货";//修改数据 context.SaveChanges(); } return(1); } }
public object updateOrderById(TB_ORDER model) { object[] sqlParams = { new SqlParameter("@N_ID", model.N_ID), new SqlParameter("@S_CUSTOMER_NAME", model.S_CUSTOMER_NAME), new SqlParameter("@S_PHONE", model.S_PHONE), new SqlParameter("@S_ADDRESS", model.S_ADDRESS), new SqlParameter("@S_DESCRIPTION", model.S_DESCRIPTION) }; var result = context.Database.SqlQuery <object>("Usp_updateOrderById @N_ID,@S_CUSTOMER_NAME,@S_PHONE,@S_ADDRESS,@S_DESCRIPTION", sqlParams).SingleOrDefault(); return(result); }
public object createOrder(TB_ORDER model, int id) { object[] sqlParams = { new SqlParameter("@N_AMOUNT", model.N_AMOUNT), new SqlParameter("@N_TOTAL", model.N_TOTAL), new SqlParameter("@S_TYPE", model.S_TYPE), new SqlParameter("@S_CUSTOMER_NAME", model.S_CUSTOMER_NAME), new SqlParameter("@S_PHONE", model.S_PHONE), new SqlParameter("@S_ADDRESS", model.S_ADDRESS), new SqlParameter("@N_ID", id), new SqlParameter("@N_CUSTOMER_ID", model.N_CUSTOMER_ID) }; var result = context.Database.SqlQuery <object>("Usp_InsertOrder @N_AMOUNT,@N_TOTAL,@S_TYPE,@S_CUSTOMER_NAME,@S_PHONE,@S_ADDRESS,@N_ID,@N_CUSTOMER_ID", sqlParams).SingleOrDefault(); return(result); }
public ActionResult Edit(OrderModel model) { try { var modelDB = new OrderDBModel(); TB_ORDER order = new TB_ORDER(); order.N_ID = model.id; order.S_CUSTOMER_NAME = model.customerName; order.S_PHONE = model.phone; order.S_ADDRESS = model.address; order.S_DESCRIPTION = model.description; modelDB.updateOrderById(order); return(RedirectToAction("List")); } catch { return(View()); } }
public ActionResult Create(int id, string type, double price, int total) { InfoSession modelSession = new InfoSession(); modelSession = SessionHelper.GetInfoSession(); if (modelSession == null) { return(RedirectToAction("Login", "User")); } else { var orderDBModel = new OrderDBModel(); TB_ORDER order = new TB_ORDER(); order.N_AMOUNT = price * total; order.N_TOTAL = total; order.S_TYPE = type; order.S_CUSTOMER_NAME = modelSession.fullName; order.S_PHONE = modelSession.phone; order.S_ADDRESS = modelSession.address; order.N_CUSTOMER_ID = modelSession.id; orderDBModel.createOrder(order, id); return(RedirectToAction("Index", "Card")); } }
public JsonResult AltOrder(TB_ORDER order, int ORDER_NO) { bool model = PersonMgr.AltOrder(order, ORDER_NO); return(Json(model)); }
public OrderAndContains() { Order = new TB_ORDER(); Products = new List <TB_CONTAINS>(); }
public static bool AltOrder(TB_ORDER order, int ORDER_NO) { int res = PersonDao.AltOrder(order, ORDER_NO); return(res > 0); }
public SingleOrder() { order = new TB_ORDER(); contain = new TB_CONTAINS(); }