protected void Page_Load(object sender, EventArgs e) { int storeid=Convert.ToInt32(Request["storeid"]); // CYUtil.setStoreId(storeid); WEC_CY_STOREMANAGER conf2 = new WEC_CY_STOREMANAGER(); WEC_CY_STOREMANAGER currStore=BLLTable<WEC_CY_STOREMANAGER>.GetRowData(conf2); HttpCookie cookie=new HttpCookie("currStore"); cookie.Values.Add("currStoreId",""+storeid); cookie.Values.Add("currStoreAddress",HttpUtility.UrlEncode(""+currStore.ADDRESS)); cookie.Values.Add("currStoreTel",""+currStore.TEL); //HttpCookie cookie2 = new HttpCookie("currStoreAddress", "" +currStore.ADDRESS ); //HttpCookie cookie3 = new HttpCookie("currStoreTel", "" + currStore.TEL); DateTime dt=DateTime.Now; TimeSpan ts=new TimeSpan(1,0,0,0); cookie.Expires = dt.Add(ts); Response.AppendCookie(cookie); //HttpCookie C= Request.Cookies[""]; WEC_CY_SELECTDISH conf = new WEC_CY_SELECTDISH(); conf.OrderBy(WEC_CY_SELECTDISH.Attribute.ORDER_DISPLAY); conf.STORE_ID = storeid; list = BLLTable<WEC_CY_SELECTDISH>.Factory("conn_canyin").Select(new WEC_CY_SELECTDISH(), conf); //BLLTable.SQL_Test.ToString(); foreach(WEC_CY_SELECTDISH s in list){ nums.Append( "," + s.FIT_NUM); } if(nums.Length>0) nums.Remove(0, 1); num = CYUtil.getItemCount(); }
protected void Page_Load(object sender, EventArgs e) { int storeid = Convert.ToInt32(Request["storeid"]); // CYUtil.setStoreId(storeid); WEC_CY_STOREMANAGER conf2 = new WEC_CY_STOREMANAGER(); WEC_CY_STOREMANAGER currStore = BLLTable <WEC_CY_STOREMANAGER> .GetRowData(conf2); HttpCookie cookie = new HttpCookie("currStore"); cookie.Values.Add("currStoreId", "" + storeid); cookie.Values.Add("currStoreAddress", HttpUtility.UrlEncode("" + currStore.ADDRESS)); cookie.Values.Add("currStoreTel", "" + currStore.TEL); //HttpCookie cookie2 = new HttpCookie("currStoreAddress", "" +currStore.ADDRESS ); //HttpCookie cookie3 = new HttpCookie("currStoreTel", "" + currStore.TEL); DateTime dt = DateTime.Now; TimeSpan ts = new TimeSpan(1, 0, 0, 0); cookie.Expires = dt.Add(ts); Response.AppendCookie(cookie); //HttpCookie C= Request.Cookies[""]; WEC_CY_SELECTDISH conf = new WEC_CY_SELECTDISH(); conf.OrderBy(WEC_CY_SELECTDISH.Attribute.ORDER_DISPLAY); conf.STORE_ID = storeid; list = BLLTable <WEC_CY_SELECTDISH> .Factory("conn_canyin").Select(new WEC_CY_SELECTDISH(), conf); //BLLTable.SQL_Test.ToString(); foreach (WEC_CY_SELECTDISH s in list) { nums.Append("," + s.FIT_NUM); } if (nums.Length > 0) { nums.Remove(0, 1); } num = CYUtil.getItemCount(); }
protected void Page_Load(object sender, EventArgs e) { string combo_nums = Request["combo_nums"]; HttpCookie cookie = Request.Cookies["currStore"]; int storeId = Convert.ToInt32(cookie.Values["currStoreId"]); if (!string.IsNullOrEmpty(combo_nums)) { //先清空 WEC_CY_ITEM conf3 = new WEC_CY_ITEM(); conf3.O_ID = 0; conf3.F_ID = 1; conf3.STORE_ID = storeId; BLLTable <WEC_CY_ITEM> .Factory("conn_canyin").Delete(conf3); int nums = Convert.ToInt32(combo_nums); WEC_CY_SELECTDISH conf = new WEC_CY_SELECTDISH(); conf.FIT_NUM = nums; conf.STORE_ID = storeId; WEC_CY_SELECTDISH selectedish = BLLTable <WEC_CY_SELECTDISH> .Factory("conn_canyin").GetRowData(conf); decimal s_id = selectedish.ID; WEC_CY_DS conf2 = new WEC_CY_DS(); conf2.S_ID = s_id; conf2.STORE_ID = storeId; List <WEC_CY_DS> list = BLLTable <WEC_CY_DS> .Factory("conn_canyin").Select(new WEC_CY_DS(), conf2); List <WEC_CY_ITEM> items = new List <WEC_CY_ITEM>(); foreach (WEC_CY_DS ds in list) { WEC_CY_ITEM item = new WEC_CY_ITEM(); item.ADDTIME = DateTime.Now; item.STATUS = 0; item.O_ID = 0; item.REMARK = ""; item.F_ID = 1; item.D_ID = ds.D_ID; item.NUM = ds.NUM; items.Add(item); } BLLTable <WEC_CY_ITEM> .Factory("conn_canyin").Insert(items, WEC_CY_ITEM.Attribute.ID); } WEC_CY_TABLESET conf4 = new WEC_CY_TABLESET(); conf4.AID = 1; conf4.TABLE_STATUS = 0; //大厅 conf4.TABLE_TYPE = 0; conf4.STORE_ID = storeId; WEC_CY_TABLESET table1 = BLLTable <WEC_CY_TABLESET> .Factory("conn_canyin").GetRowData(conf4); WEC_CY_TABLESET conf5 = new WEC_CY_TABLESET(); conf5.AID = 1; //可预订 conf5.TABLE_STATUS = 0; //包厢 conf5.TABLE_TYPE = 1; conf5.STORE_ID = storeId; WEC_CY_TABLESET table2 = BLLTable <WEC_CY_TABLESET> .Factory("conn_canyin").GetRowData(conf5); if (table1 == null && table2 == null) { } else if (table1 != null && table2 == null) { Dictionary <string, string> d1 = new Dictionary <string, string>(); d1.Add("title", "大厅"); d1.Add("value", "0"); list.Add(d1); //sb.Append("{\"num\":" + list.Count + ",\"total\":\"" + total + "\",\"type\":[{\"title\":\"大厅\",\"value\":0}]}"); } else if (table1 == null && table2 != null) { Dictionary <string, string> d1 = new Dictionary <string, string>(); d1.Add("title", "包厢"); d1.Add("value", "1"); list.Add(d1); //sb.Append("{\"num\":" + list.Count + ",\"total\":\"" + total + "\",\"type\":[{\"title\":\"包厢\",\"value\":1}]}"); } else if (table1 != null && table2 != null) { Dictionary <string, string> d1 = new Dictionary <string, string>(); d1.Add("title", "大厅"); d1.Add("value", "0"); Dictionary <string, string> d2 = new Dictionary <string, string>(); d2.Add("title", "包厢"); d2.Add("value", "1"); list.Add(d1); list.Add(d2); } }
protected void Page_Load(object sender, EventArgs e) { string combo_nums = Request["combo_nums"]; HttpCookie cookie = Request.Cookies["currStore"]; int storeId = Convert.ToInt32(cookie.Values["currStoreId"]); if (!string.IsNullOrEmpty(combo_nums)) { //先清空 WEC_CY_ITEM conf3 = new WEC_CY_ITEM(); conf3.O_ID = 0; conf3.F_ID = 1; conf3.STORE_ID = storeId; BLLTable<WEC_CY_ITEM>.Factory("conn_canyin").Delete(conf3); int nums = Convert.ToInt32(combo_nums); WEC_CY_SELECTDISH conf = new WEC_CY_SELECTDISH(); conf.FIT_NUM = nums; conf.STORE_ID = storeId; WEC_CY_SELECTDISH selectedish = BLLTable<WEC_CY_SELECTDISH>.Factory("conn_canyin").GetRowData(conf); decimal s_id = selectedish.ID; WEC_CY_DS conf2 = new WEC_CY_DS(); conf2.S_ID = s_id; conf2.STORE_ID = storeId; List<WEC_CY_DS> list = BLLTable<WEC_CY_DS>.Factory("conn_canyin").Select(new WEC_CY_DS(), conf2); List<WEC_CY_ITEM> items = new List<WEC_CY_ITEM>(); foreach (WEC_CY_DS ds in list) { WEC_CY_ITEM item = new WEC_CY_ITEM(); item.ADDTIME = DateTime.Now; item.STATUS = 0; item.O_ID = 0; item.REMARK = ""; item.F_ID = 1; item.D_ID = ds.D_ID; item.NUM = ds.NUM; items.Add(item); } BLLTable<WEC_CY_ITEM>.Factory("conn_canyin").Insert(items, WEC_CY_ITEM.Attribute.ID); } WEC_CY_TABLESET conf4 = new WEC_CY_TABLESET(); conf4.AID = 1; conf4.TABLE_STATUS = 0; //大厅 conf4.TABLE_TYPE = 0; conf4.STORE_ID = storeId; WEC_CY_TABLESET table1 = BLLTable<WEC_CY_TABLESET>.Factory("conn_canyin").GetRowData(conf4); WEC_CY_TABLESET conf5 = new WEC_CY_TABLESET(); conf5.AID = 1; //可预订 conf5.TABLE_STATUS = 0; //包厢 conf5.TABLE_TYPE = 1; conf5.STORE_ID = storeId; WEC_CY_TABLESET table2 = BLLTable<WEC_CY_TABLESET>.Factory("conn_canyin").GetRowData(conf5); if (table1 == null && table2 == null) { } else if (table1 != null && table2 == null) { Dictionary<string, string> d1 = new Dictionary<string, string>(); d1.Add("title", "大厅"); d1.Add("value","0"); list.Add(d1); //sb.Append("{\"num\":" + list.Count + ",\"total\":\"" + total + "\",\"type\":[{\"title\":\"大厅\",\"value\":0}]}"); } else if (table1 == null && table2 != null) { Dictionary<string, string> d1 = new Dictionary<string, string>(); d1.Add("title", "包厢"); d1.Add("value", "1"); list.Add(d1); //sb.Append("{\"num\":" + list.Count + ",\"total\":\"" + total + "\",\"type\":[{\"title\":\"包厢\",\"value\":1}]}"); } else if (table1 != null && table2 != null) { Dictionary<string, string> d1 = new Dictionary<string, string>(); d1.Add("title", "大厅"); d1.Add("value", "0"); Dictionary<string, string> d2 = new Dictionary<string, string>(); d2.Add("title", "包厢"); d2.Add("value", "1"); list.Add(d1); list.Add(d2); } }