public void GetBuildingByInventory(HttpContext context) { string callback = context.Request["jsoncallback"]; string invenid = context.Request["invenid"]; string type = context.Request["type"]; //序列化 System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer(); DataTable dt = new EmsBLL.InventoryListDetail().GetBuildingByInventory(invenid, type); StringBuilder orgJson = new StringBuilder(); string selid = ""; if (dt.Rows.Count > 0) { selid = dt.Rows[0]["Id"].ToString(); for (int i = 0; i < dt.Rows.Count; i++) { var liclass = i == 0 ? " class='selected_build' " : ""; orgJson.Append("<li " + liclass + " id='buildli_" + dt.Rows[i]["Id"] + "' onclick='BuildLiClick(this)'>" + dt.Rows[i]["Name"] + "</li>"); } } //输出Json HttpContext.Current.Response.Write(callback + "({\"result\":\"" + orgJson.ToString() + "\",\"selid\":\"" + selid + "\"})"); HttpContext.Current.Response.End(); }
public void GetInvenModelByBarcode(HttpContext context) { string callback = context.Request["jsoncallback"]; string invenid = context.Request["invenid"]; string barcode = context.Request["barcode"]; //序列化 System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer(); EmsModel.View_InvenRoomEquip ind = new EmsBLL.InventoryListDetail().GetInvenModelByBarcode(invenid, barcode); //输出Json HttpContext.Current.Response.Write(callback + "({\"result\":" + jss.Serialize(ind) + "})"); HttpContext.Current.Response.End(); }
public void GetEquipByInvenRoomId(HttpContext context) { string callback = context.Request["jsoncallback"]; string invenid = context.Request["invenid"]; string roomid = context.Request["roomid"]; //序列化 System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer(); EmsModel.JsonModel mod = new EmsBLL.InventoryListDetail().GetJsonModelEquip(invenid, roomid); //输出Json HttpContext.Current.Response.Write(callback + "({\"result\":" + jss.Serialize(mod) + "})"); HttpContext.Current.Response.End(); }
public void DiskBackEquip(HttpContext context) { string callback = context.Request["jsoncallback"]; int itemid = Convert.ToInt32(context.Request["itemid"]); EmsModel.InventoryListDetail det = new EmsBLL.InventoryListDetail().GetEmsModel(itemid); det.Id = itemid; det.IsLoss = true; int result = new EmsBLL.InventoryListDetail().Update(det); //输出Json HttpContext.Current.Response.Write(callback + "({\"result\":" + result + "})"); HttpContext.Current.Response.End(); }
public void CreateInventoryList(HttpContext context) { string callback = context.Request["jsoncallback"]; int planid = Convert.ToInt32(context.Request["planid"]); string type = context.Request["type"]; string useridcard = context.Request["useridcard"]; //序列化 System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer(); EmsModel.JsonModel mod = new EmsBLL.InventoryListDetail().CreateInventoryList(planid, type, useridcard); //输出Json HttpContext.Current.Response.Write(callback + "({\"result\":" + jss.Serialize(mod) + "})"); HttpContext.Current.Response.End(); }
public void SaveRoomInventory(HttpContext context) { string callback = context.Request["jsoncallback"]; string invenid = context.Request["invenid"]; string roomid = context.Request["roomid"]; string idStr = context.Request["idStr"]; string editStr = context.Request["editStr"]; string useridcard = context.Request["useridcard"]; //序列化 System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer(); EmsModel.JsonModel mod = new EmsBLL.InventoryListDetail().SaveRoomInventory(invenid, roomid, idStr, editStr, useridcard); //输出Json HttpContext.Current.Response.Write(callback + "({\"result\":" + jss.Serialize(mod) + "})"); HttpContext.Current.Response.End(); }
public void GetLayersAndRoomsByInvenId(HttpContext context) { string callback = context.Request["jsoncallback"]; string invenid = context.Request["invenid"]; string buildid = context.Request["buildid"]; string buildname = context.Request["buildname"]; string type = context.Request["type"]; //序列化 System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer(); DataTable dt = new EmsBLL.InventoryListDetail().GetLayersAndRoomsByInvenId(invenid, buildid, type); StringBuilder orgJson = new StringBuilder(); DataRow[] parLayer = dt.Select("Pid=" + buildid);//得到楼层信息 if (parLayer.Count() > 0) { for (int i = 0; i < parLayer.Count(); i++) { orgJson.Append("<dl class='listIndex' attr='terminal_brand_s'>"); orgJson.Append("<dt>第" + parLayer[i]["Name"].ToString() + "层</dt>"); orgJson.Append("<dd>"); DataRow[] subRoom = dt.Select(" Pid=" + parLayer[i]["Id"].ToString());//得到房间信息 if (subRoom.Count() > 0) { for (int j = 0; j < subRoom.Count(); j++) { if (subRoom[j]["Status"].ToString() == "0") { orgJson.Append("<label><a href='javascript:void(0);' style='background:white;' onclick=\"OpenIFrameWindow('房间盘点', 'RoomInventory.aspx?itemid=" + subRoom[j]["Id"].ToString() + "&invenid=" + invenid + "&ppid=" + buildid + "&status=" + subRoom[j]["Status"].ToString() + "&roomname=" + buildname + "-" + subRoom[j]["RoomNo"].ToString() + "(" + subRoom[j]["Name"].ToString() + ")" + "','560px','500px');\"><span class='liangge'>" + subRoom[j]["RoomNo"] + "</span><span class='liangge'>" + subRoom[j]["Name"] + "</span></a></label>"); } else { orgJson.Append("<label><a href='javascript:void(0);' style='background:#54FF9F;' onclick=\"OpenIFrameWindow('房间盘点', 'RoomInventory.aspx?itemid=" + subRoom[j]["Id"].ToString() + "&invenid=" + invenid + "&ppid=" + buildid + "&status=" + subRoom[j]["Status"].ToString() + "&roomname=" + buildname + "-" + subRoom[j]["RoomNo"].ToString() + "(" + subRoom[j]["Name"].ToString() + ")" + "','560px','500px');\"><span class='liangge'>" + subRoom[j]["RoomNo"] + "</span><span class='liangge'>" + subRoom[j]["Name"] + "</span></a></label>"); } } } orgJson.Append("</dd>"); orgJson.Append("</dl>"); } } //输出Json HttpContext.Current.Response.Write(orgJson.ToString()); //HttpContext.Current.Response.Write(callback + "({\"result\":\"" + orgJson.ToString() + "\"})"); HttpContext.Current.Response.End(); }