public int AuditBooking(DishBook objDishBook) { string sql = "UPDATE [dbo].[DishBook] SET OrderStatus = @OrderStatus WHERE BookId = @BookId"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@OrderStatus", objDishBook.OrderStatus), new SqlParameter("@BookId", objDishBook.BookId) }; int result = SQLHelper.Update(sql, param); return(result); }
public ActionResult DoAdd(DishBook objDish) { objDish.BookTime = DateTime.Now; int res = new DishBookManager().Book(objDish); if (res > 0) { return(Content("success")); } else { return(Content("error")); } }
/// <summary> /// 在线预订,向数据库插入一条数据 /// </summary> /// <param name="objDish"></param> /// <returns></returns> public ActionResult DoAdd(DishBook objDish) { //调用BLL层新增数据 objDish.BookTime = DateTime.Now;//设置当前时间 int result = new BLL.DishBookManager().Book(objDish); if (result > 0)//成功 { //return Content("<script>alert('新增成功!');location.href='"+Url.Action("Index", "CompanyInfo") +"';</script>"); return(Content("success")); } else//失败 { //return Content("<script>alert('新增失败!');location.href='" + Url.Action("DishesBooks", "CompanyDishes") + "';</script>"); return(Content("error")); } }
/// <summary> /// Book the dish /// </summary> /// <param name="objDishBook"></param> /// <returns></returns> public int BookDish(DishBook objDishBook) { string sql = "INSERT INTO [dbo].[DishBook] (BookTime, ConsumeTime, ConsumePersons, HotelName, CustomerName, CustomerPhone, CustomerEmail, Comments, OrderStatus, RoomType) VALUES (@BookTime, @ConsumeTime, @ConsumePersons, @HotelName, @CustomerName, @CustomerPhone, @CustomerEmail, @Comments, @OrderStatus, @RoomType)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@BookTime", objDishBook.BookTime), new SqlParameter("@ConsumeTime", objDishBook.ConsumeTime), new SqlParameter("@ConsumePersons", objDishBook.ConsumePersons), new SqlParameter("@HotelName", objDishBook.HotelName), new SqlParameter("@CustomerName", objDishBook.CustomerName), new SqlParameter("@CustomerPhone", objDishBook.CustomerPhone), new SqlParameter("@CustomerEmail", objDishBook.CustomerEmail), new SqlParameter("@Comments", objDishBook.Comments), new SqlParameter("@OrderStatus", objDishBook.OrderStatus), new SqlParameter("@RoomType", objDishBook.RoomType), }; int result = SQLHelper.Update(sql, param); return(result); }
/// <summary> /// 客户预定 /// </summary> /// <param name="objDishBook"></param> /// <returns></returns> public int Book(DishBook objDishBook) { StringBuilder strsql = new StringBuilder(); strsql.Append("INSERT INTO DishBook "); strsql.Append("(HotelName,ConsumeTime,ConsumePersons,"); strsql.Append("RoomType,CustomerName,CustomerPhone,"); strsql.Append("CustomerEmail,Comments)"); strsql.Append(" VALUES (@HotelName,@ConsumeTime,@ConsumePersons,"); strsql.Append("@RoomType,@CustomerName,@CustomerPhone,"); strsql.Append("@CustomerEmail,@Comments)"); SqlParameter[] param = new SqlParameter[] { new SqlParameter("@HotelName", objDishBook.HotelName), new SqlParameter("@ConsumeTime", objDishBook.ConsumeTime), new SqlParameter("@ConsumePersons", objDishBook.ConsumePersons), new SqlParameter("@RoomType", objDishBook.RoomType), new SqlParameter("@CustomerName", objDishBook.CustomerName), new SqlParameter("@CustomerPhone", objDishBook.CustomerPhone), new SqlParameter("@CustomerEmail", objDishBook.CustomerEmail), new SqlParameter("@Comments", objDishBook.Comments) }; return(SQLHelper.Update(strsql.ToString(), param)); }
/// <summary> /// 客户预定 /// </summary> /// <param name="objDishBook"></param> /// <returns></returns> public int Book(DishBook objDishBook) { return(objDishBookS.Book(objDishBook)); }
public int AuditBooking(DishBook objDishBook) { return(objDishBookService.AuditBooking(objDishBook)); }
public int BookDish(DishBook objDishBook) { return(objDishBookService.BookDish(objDishBook)); }
/// <summary> /// 客户预定 /// </summary> /// <param name="objDishBook"></param> /// <returns></returns> public int Book(DishBook objDishBook) { return(new DAL.DishBookService().Book(objDishBook)); }