protected void Page_Load(object sender, EventArgs e) { BLL.RepairTaskBLL repairBLL = new BLL.RepairTaskBLL(); DataTable dt = new DataTable(); if (!IsPostBack) { try { dt = repairBLL.GetTypeAndCount(MainID, UserID); HF.Cloud.BLL.Common.Logger.Error("Repair.aspx页面dt.rows:" + dt.Rows.Count + "---MainID:" + MainID + "----userID:" + UserID); } catch (Exception err) { BLL.Common.Logger.Error("RepairType GetTypeAndCount Error", err); } } if (dt != null && dt.Rows.Count > 0) { htmlStr.Append("<div class=\"oneself-list eweic-top div_height\"><div class=\"innerdiv\"><a href = \"RepairList.aspx?dd_nav_bgcolor=FF5E97F6&RepairType=" + dt.Columns[0].ToString() + "\" ><img class=\"img_style\" src=\"../img/c.png\" /> <label class=\"label_style\" >未分配</label><label class=\"label_style\">" + dt.Rows[0][0].ToString() + "</label></a></div></div>"); htmlStr.Append("<div class=\"oneself-list eweic-top div_height\"><div class=\"innerdiv\"><a href = \"RepairList.aspx?dd_nav_bgcolor=FF5E97F6&RepairType=" + dt.Columns[1].ToString() + "\" ><img class=\"img_style\" src=\"../img/c.png\" /> <label class=\"label_style\" >我的未完成维修单 </label><label class=\"label_style\">" + dt.Rows[0][1].ToString() + "</label></a></div></div>"); htmlStr.Append("<div class=\"oneself-list eweic-top div_height\"><div class=\"innerdiv\"><a href = \"RepairList.aspx?dd_nav_bgcolor=FF5E97F6&RepairType=" + dt.Columns[2].ToString() + "\" ><img class=\"img_style\" src=\"../img/c.png\" /> <label class=\"label_style\" >所有维修单 </label><label class=\"label_style\">" + dt.Rows[0][2].ToString() + "</label></a></div></div>"); htmlStr.Append("<div class=\"oneself-list eweic-top div_height\"><div class=\"innerdiv\"><a href = \"RepairList.aspx?dd_nav_bgcolor=FF5E97F6&RepairType=" + dt.Columns[3].ToString() + "\" ><img class=\"img_style\" src=\"../img/c.png\" /> <label class=\"label_style\" >我的所有维修单</label><label class=\"label_style\">" + dt.Rows[0][3].ToString() + "</label></a></div></div>"); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string taskID = context.Request.QueryString["repairID"].ToString(); //工单ID string teamID = context.Request.QueryString["teamID"].ToString(); //受理组ID string acceptID = context.Request.QueryString["acceptID"].ToString(); //受理人ID string userID = context.Request.QueryString["userID"].ToString(); //发布人ID int flag = 0; BLL.RepairTaskBLL repairBLL = new BLL.RepairTaskBLL(); try { Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("TaskId", taskID); dic.Add("UpdateType", "Accept"); dic.Add("Values", teamID + "$" + userID); dic.Add("ChgeUserId", userID); flag = repairBLL.ChangeTaskInfo(dic); } catch (Exception err) { BLL.Common.Logger.Error("repairTransfer.ashx Error", err); } if (flag > 0) { context.Response.Write("success"); } }
public string taskDetailStr = string.Empty; //描述 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!String.IsNullOrEmpty(Request.QueryString["RepairID"])) { string repairID = Request.QueryString["RepairID"].ToString(); hf_repairID.Value = repairID; hf_userID.Value = UserID.ToString(); repairIDStr = repairID; BLL.Common.Logger.Error("repairID" + repairID); BLL.RepairTaskBLL repairBLL = new BLL.RepairTaskBLL(); List <Dictionary <string, object> > json = new List <Dictionary <string, object> >(); try { json = repairBLL.GetTaskDetails(long.Parse(repairID)); } catch (Exception err) { BLL.Common.Logger.Error("RepairDetail GetTaskDetails Error", err); } BLL.Common.Logger.Error("json.Count:" + json.Count); if (json.Count > 0) { typeNameStr = json[0]["TypeName"].ToString(); // BLL.Common.Logger.Error("typeNameStr" + typeNameStr); taskStatusStr = json[0]["taskStatus"].ToString(); // BLL.Common.Logger.Error("taskStatusStr" + taskStatusStr); realseNameStr = json[0]["realseName"].ToString(); //BLL.Common.Logger.Error("realseNameStr" + realseNameStr); writeTimeStr = json[0]["WriteTime"].ToString(); // BLL.Common.Logger.Error("writeTimeStr" + writeTimeStr); useTimeStr = json[0]["UseTime"].ToString(); //BLL.Common.Logger.Error("useTimeStr" + useTimeStr); linkNameStr = json[0]["LinkName"].ToString(); BLL.Common.Logger.Error("linkNameStr" + linkNameStr); linkTelStr = json[0]["LinkTel"].ToString(); BLL.Common.Logger.Error("linkTelStr" + linkTelStr); acceptNameStr = json[0]["acceptName"].ToString(); BLL.Common.Logger.Error("acceptName" + acceptNameStr); taskDetailStr = json[0]["TaskDetail"].ToString(); BLL.Common.Logger.Error("TaskDetail" + taskDetailStr); } } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; //获取消息类型文字,图片,声音等 string replyType = context.Request.QueryString["type"]; string returnStr = string.Empty; switch (replyType) { case "Character": { //returnStr = GetPatrolRecord(long.Parse(context.Request.QueryString["id"].ToString())); string jsonStr = GetReplyResult(context); // SheetBL bl = new SheetBL(); // long sqlResult = bl.InsertAPPChat(jsonStr); long sqlResult = 0; BLL.RepairTaskBLL repairTask = new BLL.RepairTaskBLL(); try { sqlResult = repairTask.InsertAPPChat(jsonStr); } catch (Exception err) { BLL.Common.Logger.Error("repairReply.ashx", err); } BLL.Common.Logger.Error("操作数据库返回的值:" + sqlResult); if (sqlResult > 0) { returnStr = "success"; } } break; case "PIC": { returnStr = ""; } break; } context.Response.Write(returnStr); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; //TaskId 维修单Id 长整形 //TaskState 维修单状态 整形 //UpdateWriter 更新人 长整形 //WriteAdr 更新地址 字符 // repairID = ' + repairID + ' & taskState = 5 & updateWriter = ' + updateWriter + ' & writeAdr = ZhanWeiFu', string taskID = context.Request.QueryString["repairID"].ToString(); string taskState = context.Request.QueryString["taskState"].ToString(); string updateWriter = context.Request.QueryString["updateWriter"].ToString(); string writeAdr = context.Request.QueryString["writeAdr"].ToString(); BLL.Common.Logger.Error("taskID:" + taskID + "--taskState:" + taskState + "--updateWriter:" + updateWriter + "--writeAdr:" + writeAdr); int flag = 0; BLL.RepairTaskBLL repairBLL = new BLL.RepairTaskBLL(); try { Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("TaskId", taskID); dic.Add("TaskState", taskState); dic.Add("UpdateWriter", updateWriter); dic.Add("WriteAdr", writeAdr); flag = repairBLL.ChangeTaskStatus(dic); BLL.Common.Logger.Error("repairBLL.ChangeTaskStatus返回值:" + flag); } catch (Exception err) { BLL.Common.Logger.Error("RepairStateChange.ashx Error", err); } if (flag > 0) { context.Response.Write("success"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!String.IsNullOrEmpty(Request.QueryString["RepairType"])) { string repairType = Request.QueryString["RepairType"].ToString(); BLL.RepairTaskBLL repairBLL = new BLL.RepairTaskBLL(); DataTable dt = new DataTable(); List <Dictionary <string, object> > json = new List <Dictionary <string, object> >(); try { if (repairType == "All") //所有维修单 { json = repairBLL.GetTaskList(MainID); if (json.Count > 0) { for (int j = 0; j < json.Count; j++) { htmlstr.Append("<div class=\"sheetType-listTitle\">" + json[j]["AcceptName"] + "</div>"); HF.Cloud.BLL.Common.Logger.Error("------AcceptName:-----" + json[j]["AcceptName"]); List <Dictionary <string, object> > json_List = (List <Dictionary <string, object> >)json[j]["NowAcceptTask"]; for (int li = 0; li < json_List.Count; li++) { string repairID = json_List[li]["ID"].ToString(); string clientName = json_List[li]["ClientName"].ToString(); string typeName = json_List[li]["TypeName"].ToString(); string writeTime = json_List[li]["WriteTime"].ToString(); HF.Cloud.BLL.Common.Logger.Error("------所有维修工单-----工单号:" + repairID + "客户名称:" + clientName); htmlstr.Append("<div class=\"sheetType-div\">"); htmlstr.Append("<a href=\"RepairDetail.aspx?dd_nav_bgcolor=FF5E97F6&repairID=" + repairID + "\">"); htmlstr.Append("<div style=\"height:30px;\">"); htmlstr.Append("<label class=\"sheetType-sheetID\">" + repairID + "</label>"); htmlstr.Append("<label class=\"sheetType-customName\">" + clientName + "</label>"); htmlstr.Append("</div>"); htmlstr.Append("<p class=\"sheetType-sheetContent\">" + typeName + "</p>"); htmlstr.Append("<p class=\"sheetType-time\">" + writeTime + "</p>"); htmlstr.Append("</a></div >"); } } } } else { dt = repairBLL.GetTaskList(repairType, MainID, UserID); if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { string repairID = dt.Rows[i]["ID"].ToString(); //维修工单id string clientName = dt.Rows[i]["ClientName"].ToString(); string typeName = dt.Rows[i]["TypeName"].ToString(); string writeTime = dt.Rows[i]["WriteTime"].ToString(); HF.Cloud.BLL.Common.Logger.Error("------维修工单-----工单号:" + repairID + "客户名称:" + clientName); htmlstr.Append("<div class=\"sheetType-div\">"); htmlstr.Append("<a href=\"RepairDetail.aspx?dd_nav_bgcolor=FF5E97F6&repairID=" + repairID + "\">"); htmlstr.Append("<div style=\"height:30px;\">"); htmlstr.Append("<label class=\"sheetType-sheetID\">" + repairID + "</label>"); htmlstr.Append("<label class=\"sheetType-customName\">" + clientName + "</label>"); htmlstr.Append("</div>"); htmlstr.Append("<p class=\"sheetType-sheetContent\">" + typeName + "</p>"); htmlstr.Append("<p class=\"sheetType-time\">" + writeTime + "</p>"); htmlstr.Append("</a></div >"); htmlstr.Append(""); } } } } catch (Exception err) { BLL.Common.Logger.Error("RepairList GetTaskList Error", err); } } } }
public string useTimeStr = string.Empty; //已耗时 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!String.IsNullOrEmpty(Request.QueryString["RepairID"])) { string repairID = Request.QueryString["RepairID"].ToString(); repairIDStr = repairID; BLL.Common.Logger.Error("repairID" + repairID); hf_repairID.Value = repairID; hf_mainID.Value = MainID.ToString(); hf_sendID.Value = UserID.ToString(); hf_sendTime.Value = DateTime.Now.ToString(); //获取当前维修单信息 BLL.RepairTaskBLL repairBLL = new BLL.RepairTaskBLL(); List <Dictionary <string, object> > json = new List <Dictionary <string, object> >(); try { json = repairBLL.GetTaskDetails(long.Parse(repairID)); } catch (Exception err) { BLL.Common.Logger.Error("RepairReply Error", err); } BLL.Common.Logger.Error("json.Count:" + json.Count); if (json.Count > 0) { typeNameStr = json[0]["TypeName"].ToString(); taskStatusStr = json[0]["taskStatus"].ToString(); realseNameStr = json[0]["realseName"].ToString(); writeTimeStr = json[0]["WriteTime"].ToString(); useTimeStr = json[0]["UseTime"].ToString(); } //获取回复列表 BLL.RepairTaskBLL repairTask = new BLL.RepairTaskBLL(); string replyStr = ""; try { //获取回复消息 replyStr = repairTask.GetAPPSheetChatListBYChatID(0, long.Parse(repairID), 2); BLL.Common.Logger.Error("RepairReply回复消息:" + replyStr); } catch (Exception err) { BLL.Common.Logger.Error("RepairReply Error", err); } List <Dictionary <string, object> > json_Reply = new List <Dictionary <string, object> >(); JavaScriptSerializer js_Reply = new JavaScriptSerializer(); js_Reply.MaxJsonLength = int.MaxValue; json_Reply = js_Reply.Deserialize <List <Dictionary <string, object> > >(replyStr); hf_chatID.Value = json_Reply[json_Reply.Count - 1]["ID"].ToString(); //保存charID最小值,刷新用 hf_userName.Value = UserName; //当前用户名字 for (int i = json_Reply.Count - 1; i > -1; i--) { //HF.Cloud.BLL.Common.Logger.Error("---" + i); //BLL.Common.Logger.Error("回复类型:" + json[i]["MessageType"].ToString()); string userName = json_Reply[i]["UserName"].ToString(); string sendTime = json_Reply[i]["SendTime"].ToString(); string sendDetail = json_Reply[i]["SendDetail"].ToString(); if (json_Reply[i]["MessageType"].ToString() == "Character")//如果是文字的话 { if (userName == UserName) { //htmlStr.Append("<div style='background-color:#CCFFFF'>" + userName + " - " + sendTime + "</div>"); //htmlStr.Append("<div>" + sendDetail + "</div>"); //htmlStr.Append("<div>---</div>"); htmlStr.Append("<div class=\"SheetReply_bigDIV\">"); htmlStr.Append("<div class=\"SheetReply_replyTitle\">"); htmlStr.Append("<div class=\"SheetReply_imgDIV_right\">"); htmlStr.Append("<img src=\"../img/z.png\"/>"); htmlStr.Append("</div>"); htmlStr.Append("<div class=\"SheetReply_nameDIV_right\">"); htmlStr.Append("<P>" + userName + "</P>"); htmlStr.Append("<P class=\"SheetReply_timeDIV\">" + sendTime + "</P>"); htmlStr.Append("</div>"); htmlStr.Append("</div>"); htmlStr.Append("<div class=\"SheetReply_replyDIV_right\">"); htmlStr.Append("<p>" + sendDetail + "</p>"); htmlStr.Append("</div>"); htmlStr.Append("</div>"); } else { //htmlStr.Append("<div>" + userName + " - " + sendTime + "</div>"); //htmlStr.Append("<div>" + sendDetail + "</div>"); //htmlStr.Append("<div>---</div>"); htmlStr.Append("<div class=\"SheetReply_bigDIV\">"); htmlStr.Append("<div class=\"SheetReply_replyTitle\">"); htmlStr.Append("<div class=\"SheetReply_imgDIV\">"); htmlStr.Append("<img src=\"../img/z.png\"/>"); htmlStr.Append("</div>"); htmlStr.Append("<div class=\"SheetReply_nameDIV\">"); htmlStr.Append("<P>" + userName + "</P>"); htmlStr.Append("<P class=\"SheetReply_timeDIV\">" + sendTime + "</P>"); htmlStr.Append("</div>"); htmlStr.Append("</div>"); htmlStr.Append("<div class=\"SheetReply_replyDIV\">"); htmlStr.Append("<p>" + sendDetail + "</p>"); htmlStr.Append("</div>"); htmlStr.Append("</div>"); } } if (json_Reply[i]["MessageType"].ToString() == "PIC")//如果是图片 { if (userName == UserName) { htmlStr.Append("<div style='background-color:#CCFFFF'>" + userName + " - " + sendTime + "</div>"); htmlStr.Append("<div>" + sendDetail + "</div>"); htmlStr.Append("<div>---</div>"); } else { htmlStr.Append("<div>" + userName + " - " + sendTime + "</div>"); htmlStr.Append("<div>" + sendDetail + "</div>"); htmlStr.Append("<div>---</div>"); } } } } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string mainIDStr = context.Request["MainID"].ToString(); string clientIDStr = context.Request["ClientID"].ToString(); string taskDetailStr = context.Request["TaskDetail"].ToString(); string taskPriorityStr = "3"; string linkNameStr = context.Request["LinkName"].ToString(); string linkTelStr = context.Request["LinkTel"].ToString(); string assetTypeIDStr = context.Request["AssetTypeID"].ToString(); string writeIDStr = context.Request["WriteID"].ToString(); string writeAdrStr = ""; string repaireSummaryStr = ""; string teamIDStr = context.Request["TeamID"].ToString(); string acceptIDStr = context.Request["AcceptID"].ToString(); Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("MainID", mainIDStr); dic.Add("ClientID", clientIDStr); dic.Add("TaskDetail", taskDetailStr); dic.Add("TaskPriority", taskPriorityStr); dic.Add("LinkName", linkNameStr); dic.Add("LinkTel", linkTelStr); dic.Add("AssetTypeID", assetTypeIDStr); dic.Add("WriteID", writeIDStr); dic.Add("WriteAdr", writeAdrStr); dic.Add("RepaireSummary", repaireSummaryStr); dic.Add("TeamID", teamIDStr); dic.Add("AcceptID", acceptIDStr); dic.Add("AssetID", string.Empty); JavaScriptSerializer js = new JavaScriptSerializer(); js.MaxJsonLength = int.MaxValue; string json = js.Serialize(dic); HF.Cloud.BLL.Common.Logger.Error("addRepair提交的数据json:" + json); long tid = 0; try { BLL.RepairTaskBLL repairBLL = new BLL.RepairTaskBLL(); tid = repairBLL.AddTask(dic); } catch (Exception err) { HF.Cloud.BLL.Common.Logger.Error("addRepair.ashx Error", err); } if (tid > 0) { context.Response.Write(tid); // 发送钉钉会话消息 sendDingSheetMessage(tid, long.Parse(acceptIDStr), long.Parse(clientIDStr), long.Parse(assetTypeIDStr)); } }
public void ProcessRequest(HttpContext context) { string result = string.Empty; context.Response.ContentType = "text/plain"; HF.Cloud.BLL.Common.Logger.Error("repairMessage.ashx进来了"); if (!string.IsNullOrEmpty(context.Request.QueryString["repairID"]) && !string.IsNullOrEmpty(context.Request.QueryString["chatID"])) { string repairID = context.Request.QueryString["repairID"].ToString(); string chatID = context.Request.QueryString["chatID"].ToString(); HF.Cloud.BLL.Common.Logger.Error("repairID:" + repairID + "chatID:" + chatID); //获取回复列表 BLL.RepairTaskBLL repairTask = new BLL.RepairTaskBLL(); string replyStr = ""; try { //获取回复消息 replyStr = repairTask.GetAPPSheetChatListBYChatID(long.Parse(chatID), long.Parse(repairID), 2); BLL.Common.Logger.Error("RepairMessage回复消息:" + replyStr); } catch (Exception err) { BLL.Common.Logger.Error("RepairMessage Error", err); } List <Dictionary <string, object> > json = new List <Dictionary <string, object> >(); JavaScriptSerializer js = new JavaScriptSerializer(); js.MaxJsonLength = int.MaxValue; json = js.Deserialize <List <Dictionary <string, object> > >(replyStr); if (json.Count > 0) { string chatID_return = json[json.Count - 1]["ID"].ToString(); //保存charID最小值,刷新用 result += "{\"result\":["; for (int i = json.Count - 1; i > -1; i--) //这样可以使新数据在最下面,老数据在上面 { string userName = json[i]["UserName"].ToString(); string sendTime = json[i]["SendTime"].ToString(); string sendDetail = json[i]["SendDetail"].ToString(); result += "{\"name\":\"" + userName; result += "\","; result += "\"time\":\"" + sendTime; result += "\","; result += "\"detail\":\"" + sendDetail; result += "\"},"; } result = result.Substring(0, result.Length - 1);//确定最后一个逗号 result += "],\"chatID\":\"" + chatID_return; result += "\"}"; } else { result = ""; } //string dd = "{\"result\":[{\"name\":\"张三\",\"time\":\"2017-2-3\",\"detail\":\"付电话费舒服的书\"},{\"name\":\"李四\",\"time\":\"2012-2-2\",\"detail\":\"还没见过图\"}],\"chatID\":\"232\"}"; // result += "{\"result\":["; ////用于循环 //result += "{\"name\":\""+"张三"; //result += "\","; //result += "\"time\":\""+ "2017-2-3"; //result += "\","; //result += "\"detail\":\""+"内容"; //result += "\"},"; //result += "],\"chatID\":\""+"123"; //result += "\"}"; } HF.Cloud.BLL.Common.Logger.Error(result); context.Response.Write(result); }