private void getUpdateData(HttpContext context) { string msg = string.Empty; string id = context.Request.QueryString["id"]; if (!string.IsNullOrEmpty(id)) { entity = bll.Find(p => p.WorkflowNodeConfigID == id); entity.WorkflowNodeConfig_Name = context.Request.QueryString["WorkflowNodeConfig_Name"]; entity.WorkflowNodeConfig_Setp = context.Request.QueryString["WorkflowNodeConfig_Setp"].ToInt(0); entity.WorkflowNodeConfig_UpdateTime = DateTime.Now; if (bll.Update(entity, out msg)) { var jsonperson = new { id = entity.WorkflowNodeConfig_Setp.ToString(), text = entity.WorkflowNodeConfig_Name, data = "更新成功" }; string jsonPerson = JsonConvert.SerializeObject(jsonperson); context.Response.Write(jsonPerson); } else { context.Response.Write("{\"data\":\"" + msg + "\"}"); } } else { context.Response.Write("{\"data\":\"更新出错\"}"); } }
private void getDownData(HttpContext context) { string id = context.Request.QueryString["id"]; int? sort = context.Request.QueryString["sort"].ToInt(0); string parid = context.Request.QueryString["parid"]; string msg = string.Empty; //entityList = bll.FindWhere(p => p.WorkflowNodeConfig_TasksInstanceID == id && p.WorkflowNodeConfig_Setp>sort).OrderBy(p => p.WorkflowNodeConfig_Setp).ToList(); //if (entityList.Count > 0) //{ // sort = entityList.Last().WorkflowNodeConfig_Setp; // entity = bll.Find(p => p.WorkflowNodeConfigID == parid); // entity.WorkflowNodeConfig_Setp = sort; // if(!bll.Update(entity,out msg)) // { // context.Response.Write("{\"data\":\"1\"}"); // } //} entity = bll.Find(p => p.WorkflowNodeConfigID == parid); entity.WorkflowNodeConfig_Setp = sort + 1; entity.WorkflowNodeConfig_UpdateTime = DateTime.Now; if (bll.Update(entity, out msg)) { context.Response.Write("{\"data\":\"1\"}"); } else { context.Response.Write("{\"data\":\"0\"}"); } }