Esempio n. 1
0
        public Result cancelOrder([FromBody] MODEL.Criteria.reqOrder req)
        {
            Result result = new Result();

            result.ResultOk = "false";
            RestaurantBLL sv = new RestaurantBLL();

            try
            {
                result = sv.cancelOrder(req);

                //Veriy Data
                //result.ResultOk = "Success";
                //for (int i = 0; i < req.listFood.Count; i++)
                //{
                //    result.ReturnMessage += req.listFood[i].foodID + ",";
                //}
                //if (req != null)
                //{

                //return sv.InsertMenu(req);

                //}
            }
            catch (Exception e)
            {
                result.ErrorMessage  = e.Message;
                result.ResultOk      = "false";
                result.ReturnMessage = "";
            }
            return(result);
        }
Esempio n. 2
0
        public Result insertOrder(MODEL.Criteria.reqOrder req)
        {
            //Result result = new Result();
            //Result OrderStatus = RestaurantDAL.getStatusOrder(req.restaurantID, req.tableID);
            //if (OrderStatus.ResultOk == "false")
            //{
            //    result = RestaurantDAL.insertOrder(req);
            //}
            //else
            //{
            //    switch (OrderStatus.ReturnMessage)
            //    {
            //        case "1":
            //            result.ResultOk = "false";
            //            result.ErroMessage = "Table is open";
            //            result.ReturnMessage = "";
            //            break;
            //        case "2":
            //            result.ResultOk = "false";
            //            result.ErroMessage = "Table is bill please";
            //            result.ReturnMessage = "";
            //            break;
            //        default:
            //            result = RestaurantDAL.insertOrder(req);
            //            break;
            //    }
            //}

            //return result;

            return(RestaurantDAL.insertOrder(req));
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                hdRestaurantID.Value = getRestaurantID();
                hdMemberID.Value     = getMemberID();
                hdOrderNo.Value      = getOrderNo();

                dtfInfo = DateTimeFormatInfo.InvariantInfo;
                MODEL.ResultOrderForBill res = new MODEL.ResultOrderForBill();

                MODEL.Criteria.reqOrder req = new MODEL.Criteria.reqOrder();
                //req.restaurantID = Session["session_retaurantID"].ToString().Trim();
                //req.tableID = Session["session_tableID"].ToString().Trim();
                req.userID       = hdMemberID.Value;     //Session["session_memberID"].ToString().Trim();
                req.orderNo      = hdOrderNo.Value;      //Session["session_orderNo"].ToString().Trim();
                req.restaurantID = hdRestaurantID.Value; //Session["session_restaurantID"].ToString().Trim();
                res = svRestaurant.getOrderListForCheckBill(req);

                txtRestaurantName.InnerText = "ชื่อร้านอาหาร : " + res.restaurantName;
                txtUser.InnerText           = ".....";
                txtTableName.InnerText      = res.tableName;
                txtTotalPrice.InnerText     = res.totalPrice.ToString();
                txtBillNo.InnerText         = req.orderNo;
                txtCurrentDate.InnerText    = DateTime.Today.ToString("dd/MM/yyyy", dtfInfo);

                repMain.DataSource = res.orderList;
                repMain.DataBind();
            }
        }
Esempio n. 4
0
        public Result insertOrder([FromBody] MODEL.Criteria.reqOrder req)
        {
            Result result = new Result();

            result.ResultOk = "false";
            RestaurantBLL sv = new RestaurantBLL();

            try
            {
                result = sv.insertOrder(req);

                //Result OrderStatus = sv.getStatusOrder(req.restaurantID, req.tableID);
                //if (OrderStatus.ResultOk == "false")
                //{
                //    result = sv.insertOrder(req);
                //}
                //else
                //{
                //    switch (OrderStatus.ReturnMessage)
                //    {
                //        case "1":
                //            result.ResultOk = "false";
                //            result.ErroMessage = "Table is open";
                //            result.ReturnMessage = "";
                //            break;
                //        case "2":
                //            result.ResultOk = "false";
                //            result.ErroMessage = "Table is bill please";
                //            result.ReturnMessage = "";
                //            break;
                //        default:
                //            result = sv.insertOrder(req);
                //            break;
                //    }
                //}


                //Veriy Data
                //result.ResultOk = "Success";
                //for (int i = 0; i < req.listFood.Count; i++)
                //{
                //    result.ReturnMessage += req.listFood[i].foodID + ",";
                //}
                //if (req != null)
                //{

                //return sv.InsertMenu(req);

                //}
            }
            catch (Exception e)
            {
                result.ErrorMessage = e.Message;
                result.ResultOk     = "false";
            }
            return(result);
        }
Esempio n. 5
0
        public Result noticeBillOrder([FromBody] MODEL.Criteria.reqOrder req)
        {
            Result result = new Result();

            result.ResultOk = "false";
            RestaurantBLL sv = new RestaurantBLL();

            try
            {
                req.statusID = "2";
                result       = sv.updateOrder(req);
            }
            catch (Exception e)
            {
                result.ErrorMessage = e.Message;
                result.ResultOk     = "false";
            }
            return(result);
        }
Esempio n. 6
0
        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            MODEL.Criteria.reqOrder req = new MODEL.Criteria.reqOrder();
            req.orderNo  = hdOrderNo.Value;  //Session["session_orderNo"].ToString().Trim();
            req.userID   = hdMemberID.Value; //Session["session_memberID"].ToString().Trim();
            req.statusID = "3";

            //Check Complete All
            if (svRestaurant.checkCompleteKitchenByOrderNo(req.orderNo).ResultOk == "false")
            {
                MSG("อาหารยังเสริฟไม่ครบไม่สามารถเช๊คบิลได้ !!!");
                return;
            }

            if (svRestaurant.updateOrderByOrderNo(req).ResultOk == "true")
            {
                MSG("Success");
            }
            else
            {
                MSG("Fail");
            }
        }
Esempio n. 7
0
 public Result updateOrder(MODEL.Criteria.reqOrder req)
 {
     return(RestaurantDAL.updateOrder(req));
 }
Esempio n. 8
0
 public ResultOrder getOrderList(MODEL.Criteria.reqOrder req)
 {
     return(RestaurantDAL.getOrderList(req));
 }
Esempio n. 9
0
 public Result cancelOrder(MODEL.Criteria.reqOrder req)
 {
     return(RestaurantDAL.cancelOrder(req));
 }