public Result Logout(MODEL.Criteria.reqTable req) { Result result = new Result(); result.ResultOk = "false"; RestaurantBLL sv = new RestaurantBLL(); DAL.Restaurant svDAL = new DAL.Restaurant(); //DAL.StringCipher sv = new DAL.StringCipher(); try { ///Check User Result UserComplete = svDAL.checkOrderNotComplete(req.userID); if (UserComplete.ResultOk == "true") { result.ResultOk = "false"; result.ErrorMessage = "User not pay !!!"; result.ReturnMessage = ""; return(result); } Result CancelTable = svDAL.cancelTable(req); result = CancelTable; } catch (Exception e) { result.ErrorMessage = e.Message; result.ResultOk = "false"; result.ReturnMessage = ""; } return(result); }
//string restaurantID = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MODEL.Criteria.reqTable req = new MODEL.Criteria.reqTable(); hdMemberID.Value = getMemberID(); hdRestaurantID.Value = getRestaurantID(); //req.restaurantID = Session["session_restaurantID"].ToString().Trim(); req.restaurantID = getRestaurantID(); dgvData.DataSource = svRestaurant.getTable(req); dgvData.DataBind(); } }
public Result getStatusOrderISBillPlease(MODEL.Criteria.reqTable req) { Result result = new Result(); result.ResultOk = "false"; RestaurantBLL sv = new RestaurantBLL(); DAL.Restaurant svDAL = new DAL.Restaurant(); //DAL.StringCipher sv = new DAL.StringCipher(); try { result = svDAL.getStatusOrderIsBillPleae(req.restaurantID, req.tableID, req.userID); } catch (Exception e) { result.ErrorMessage = e.Message; result.ResultOk = "false"; result.ReturnMessage = ""; } return(result); }
public Result CancelTable(MODEL.Criteria.reqTable req) { Result result = new Result(); result.ResultOk = "false"; RestaurantBLL sv = new RestaurantBLL(); DAL.Restaurant svDAL = new DAL.Restaurant(); //DAL.StringCipher sv = new DAL.StringCipher(); try { result = svDAL.cancelTable(req); } catch (Exception e) { result.ErrorMessage = e.Message; result.ResultOk = "false"; result.ReturnMessage = ""; } return(result); }
protected void btnEdit_Click(object sender, EventArgs e) { if (txtTableName.Value.Trim() == "") { MSG("กรุณาป้อนชื่อโต๊ะ !!!"); return; } MODEL.Result res = new MODEL.Result(); MODEL.Criteria.reqTable req = new MODEL.Criteria.reqTable(); req.restaurantID = hdRestaurantID.Value; req.tableDetail = txtTableName.Value.Trim(); req.tableGroupID = ddlCategoryTable.SelectedValue.ToString().Trim(); req.tableTypeID = ddlTypeTable.SelectedValue.ToString().Trim(); req.tableRemark = txtRemark.Value.Trim(); req.userID = hdMemberID.Value; //req.QRCode = res = svRestaurant.insertTable(req); if (res.ResultOk == "true") { MSG("Success"); } }
public List <Table> getTable(MODEL.Criteria.reqTable req) { return(RestaurantDAL.getTable(req)); }
public Result insertTable(MODEL.Criteria.reqTable req) { return(RestaurantDAL.insertTable(req)); }
public ResultDecode DecodeQRTable(MODEL.Criteria.reqTableQRCode req) { ResultDecode result = new ResultDecode(); ResultDecode result2 = new ResultDecode(); result.ResultOk = "false"; RestaurantBLL sv = new RestaurantBLL(); DAL.Restaurant svDAL = new DAL.Restaurant(); //DAL.StringCipher sv = new DAL.StringCipher(); try { string password = "******"; string decryptedstring = DAL.StringCipher.Decrypt(req.QRCode, password); //result.ResultOk = "true"; //result.ErrorMessage = ""; //result.ReturnMessage = ""; result2 = JsonConvert.DeserializeObject <ResultDecode>(decryptedstring); DAL.Restaurant _DAL = new DAL.Restaurant(); _DAL.insertLog(result2.ToString()); _DAL.insertLog(result.restaurantID + " " + result.tableID); result.restaurantID = result2.restaurantID; result.tableID = result2.tableID; result.tableName = sv.getTableName(result2.tableID).ReturnMessage;//getTableName; Result TypeTable = sv.getTypeTable(result.restaurantID, result.tableID); if (TypeTable.ReturnMessage == "1") { //Result FrontTable = svDAL.getbookStatusTableTypeIsBook(result.restaurantID, result.tableID, req.userID, "1"); //if (FrontTable.ResultOk == "false") //{ // result.ResultOk = "true"; // result.ReturnMessage = ""; // result.ErrorMessage = ""; //} //else //{ // result.ResultOk = "false"; // result.ReturnMessage = "Table is use !!!"; // result.ErrorMessage = ""; //} //Result FrontTable = svDAL.canOpenOrderFrontTable(result.restaurantID, result.tableID, req.userID); //if(FrontTable.ResultOk != "false") //{ // result.ResultOk = "true"; // result.ReturnMessage = FrontTable.ResultOk; // result.ErrorMessage = ""; //} //else //{ // result.ResultOk = "false"; // result.ReturnMessage = FrontTable.ReturnMessage; // result.ErrorMessage = FrontTable.ErrorMessage; //} //result.ResultOk = "true" } else { //get user in process on table Result resultgetUserinTabl = svDAL.getUserProcessInTable(result.restaurantID, result.tableID, req.userID); if (resultgetUserinTabl.ResultOk == "true") { result.ResultOk = "true"; result.ReturnMessage = ""; result.ErrorMessage = ""; return(result); } Result NormalTable = svDAL.getbookStatusTableTypeIsBook(result.restaurantID, result.tableID, req.userID, "2"); if (NormalTable.ResultOk == "false") { result.ResultOk = "true"; result.ReturnMessage = NormalTable.ReturnMessage; result.ErrorMessage = ""; MODEL.Criteria.reqTable reqTable = new MODEL.Criteria.reqTable(); reqTable.tableID = result.tableID; reqTable.userID = req.userID; Result updateTable = svDAL.bookTable(reqTable); if (updateTable.ResultOk == "false") { result.ResultOk = "false"; result.ErrorMessage = updateTable.ErrorMessage; } } else { result.ResultOk = "false"; result.ReturnMessage = "Table is use !!!"; result.ErrorMessage = ""; } //Result NormalTable = svDAL.canOpenOrder(result.restaurantID, result.tableID, req.userID); //if (NormalTable.ResultOk != "false") //{ // result.ResultOk = "true"; // result.ReturnMessage = NormalTable.ResultOk; // result.ErrorMessage = ""; //} //else //{ // result.ResultOk = "false"; // result.ReturnMessage = NormalTable.ReturnMessage; // result.ErrorMessage = NormalTable.ErrorMessage; //} } } catch (Exception e) { result.ErrorMessage = e.Message; result.ResultOk = "false"; result.ReturnMessage = ""; } return(result); }