Example #1
0
        protected void btnRecommend_Click(object sender, EventArgs e)
        {
            string confirmValue = Request.Form["confirm_value"];

            if (hdConfirm.Value == "Yes")
            {
                String fid;
                fid = hdFoodID.Value;
                MODEL.Result res  = new MODEL.Result();
                BLL.Menu     _BLL = new BLL.Menu();
                if (_BLL.setRecommend(fid, "1").ResultOk == "true")
                {
                    string URL = @"memberID=" + hdMemberID.Value + "&restaurantID=" + hdRestaurantID.Value;
                    URL = svURL.Encrypt(URL, "r0b1nr0y");

                    Response.Redirect("MenuList.aspx?" + URL, true);
                }
            }
            else
            {
                String fid;
                fid = hdFoodID.Value;
                MODEL.Result res  = new MODEL.Result();
                BLL.Menu     _BLL = new BLL.Menu();
                if (_BLL.setRecommend(fid, "0").ResultOk == "true")
                {
                    string URL = @"memberID=" + hdMemberID.Value + "&restaurantID=" + hdRestaurantID.Value;
                    URL = svURL.Encrypt(URL, "r0b1nr0y");

                    Response.Redirect("MenuList.aspx?" + URL, true);
                }
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            MODEL.Criteria.reqRestaurant model = new MODEL.Criteria.reqRestaurant();
            model.RestaurantName      = txtRestaurantName.Value.Trim();
            model.RestaurantLat       = hid_lat.Value.Trim();
            model.RestaurantLong      = hid_lng.Value.Trim();
            model.RestaurantImagePath = hdRestaurantID.Value + ".jpg";

            model.ContactAddressNo = txtAddressNo.Value.Trim();
            model.ContactMoo       = txtAddressMoo.Value.Trim();
            model.ContactSoi       = txtAddressSoi.Value.Trim();
            model.ContactRoad      = txtAddressRoad.Value.Trim();
            model.ContactProvince  = Convert.ToInt32(ddlProvince.SelectedValue.ToString().Trim());
            model.ContactAmphur    = Convert.ToInt32(ddlAmphur.SelectedValue.ToString().Trim());
            model.ContactTumbon    = Convert.ToInt32(ddlTumbon.SelectedValue.ToString().Trim());
            model.ContactZipcode   = txtZipCode.Value.Trim();
            model.ContactTel       = txtTel.Value.Trim();
            model.ContactPhone     = txtPhone.Value.Trim();
            model.RestaurantID     = hdRestaurantID.Value; //Session["session_restaurantID"].ToString().Trim();
            model.UserID           = hdMemberID.Value;     //Session["session_memberID"].ToString().Trim();

            MODEL.Result res = new MODEL.Result();
            res = svRestaurant.updateRestaurant(model);
            if (res.ResultOk == "true")
            {
                MSG("Updated");
                string URL = @"memberID=" + hdMemberID.Value + "&restaurantID=" + hdRestaurantID.Value;
                URL = svURL.Encrypt(URL, "r0b1nr0y");
                Response.Redirect("~/Restaurant/DashboardCashier.aspx?" + URL);
            }
            else
            {
                MSG("Updated Fail !!!");
            }
        }
Example #3
0
        public static MODEL.Result CheckBarcodeForEntry(string barcode, DAL.Nodejs api)
        {
            MODEL.Result result = new MODEL.Result();

            var       json    = CheckBarcode.CheckBarcodeJSON(barcode, api.LoginToken);
            var       dataset = api.GetDataSet(json, "Execute");
            DataTable dt      = dataset.Tables["datatable1"];

            if (dt.Rows.Count > 0)
            {
                result.Success = Convert.ToBoolean(dt.Rows[0]["SUCCESS"]);
                result.Message = dt.Rows[0]["MESSAGE"].ToString();
            }
            else
            {
                result.Success = false;
                result.Message = "Procedure did not returned any message";
            }
            return(result);
        }
Example #4
0
        protected void btnView_Click(object sender, EventArgs e)
        {
            string confirmValue = Request.Form["confirm_value"];

            if (hdConfirm.Value == "Yes")
            {
                //  this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('You clicked YES!')", true);
                String fid;
                fid = hdFoodID.Value;
                MODEL.Result res  = new MODEL.Result();
                BLL.Menu     _BLL = new BLL.Menu();
                if (_BLL.deleteMenu(fid).ResultOk == "true")
                {
                    string URL = @"memberID=" + hdMemberID.Value + "&restaurantID=" + hdRestaurantID.Value;
                    URL = svURL.Encrypt(URL, "r0b1nr0y");

                    Response.Redirect("MenuList.aspx?" + URL, true);
                }
            }
            else
            {
                // this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('You clicked NO!')", true);
            }
        }
Example #5
0
        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");
            }
        }