public string Pqcheck_submitsignal(string json1) { try { JObject item = (JObject)JsonConvert.DeserializeObject(json1); string pqname = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; // int a_id = Convert.ToInt32(item["a_id"]); string a_ids = item["a_id"].ToString(); List <string> a_id = a_ids.Split(new char[] { ',' }).ToList(); DateTime time = DateTime.Now; TablesManagment tm = new TablesManagment(); for (int i = 0; i < a_id.Count(); i++) { tm.Pqcheck_byid(Convert.ToInt32(a_id[i]), pqname, time); A5dot2Tab1 new_5dot21 = new A5dot2Tab1(); new_5dot21.pqCheckTime = DateTime.Now; new_5dot21.pqUserName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; new_5dot21.isRectified = 1; new_5dot21.state = 1; new_5dot21.Id = Convert.ToInt32(a_id[i]); string res = Sx.ModifySxItem1(new_5dot21); } } catch (Exception e) { return(""); } return("/A5dot2/Index"); }
public Index_ModelforA5dot2 getRecord_detail(string id) { Index_ModelforA5dot2 RecordforA5dot2 = new Index_ModelforA5dot2(); RecordforA5dot2.Am = new List <A5dot2Tab1>(); RecordforA5dot2.Hm = new List <A5dot2Tab1>(); ViewBag.curtime = DateTime.Now.ToString(); ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; int IntId = Convert.ToInt32(id); List <A5dot2Tab1> miss = Sx.GetSxItem_detail(IntId); foreach (var item in miss) { A5dot2Tab1 a = new A5dot2Tab1(); a.cjName = item.cjName; a.zzName = item.zzName; a.sbGyCode = item.sbGyCode; a.sbCode = item.sbCode; a.sbType = item.sbType; a.zyType = item.zyType; string[] str = (item.problemDescription).Split(new[] { "(未整改)" }, StringSplitOptions.None); a.problemDescription = str[0]; a.temp1 = Convert.ToString(miss.IndexOf(item) + 1); a.state = item.state; a.Id = item.Id; RecordforA5dot2.Am.Add(a); } return(RecordforA5dot2); }
public bool AddSxRecord(A5dot2Tab1 nVal) { using (var db = base.NewDB()) { try { db.A5dot2Tab1.Add(nVal); db.SaveChanges(); return(true); } catch { return(false); } } }
public string ZzSubmit_Bcsignal(string json1) { try { JObject item = (JObject)JsonConvert.DeserializeObject(json1); A5dot1Tab1 a5dot1Tab1 = new A5dot1Tab1(); DateTime my = DateTime.Now; int cjid = Em.getEA_parentid(Convert.ToInt32(item["Zz_Id"])); string cjname = Eam.getEa_namebyId(cjid); A5dot2Tab1 new_5dot2 = new A5dot2Tab1(); new_5dot2.cjName = cjname; new_5dot2.zzName = item["Zz_Name"].ToString(); new_5dot2.sbGyCode = item["Equip_GyCode"].ToString(); new_5dot2.sbCode = item["Equip_Code"].ToString(); new_5dot2.sbType = item["Equip_Type"].ToString(); new_5dot2.zyType = item["Zy_Type"].ToString(); new_5dot2.problemDescription = item["problemDescription"].ToString(); new_5dot2.jxSubmitTime = DateTime.Now; new_5dot2.jxUserName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; new_5dot2.isRectified = 0; new_5dot2.state = 0; new_5dot2.temp2 = item["wfe_id"].ToString(); bool res = Sx.AddSxItem(new_5dot2); string wfe_id = item["wfe_id"].ToString(); //paras Dictionary <string, string> signal = new Dictionary <string, string>(); signal["ZzSubmit_done"] = "true"; //record Dictionary <string, string> record = new Dictionary <string, string>(); record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(wfe_id), signal, record); } catch (Exception e) { return(""); } return("/A5dot2/Index"); }
public string ModifySxRecord1(A5dot2Tab1 nVal) { using (var db = base.NewDB()) { try { var modifyA5dot2Tab1 = db.A5dot2Tab1.Where(a => a.Id == nVal.Id).First(); modifyA5dot2Tab1.pqCheckTime = nVal.pqCheckTime; modifyA5dot2Tab1.pqUserName = nVal.pqUserName; modifyA5dot2Tab1.isRectified = nVal.isRectified; modifyA5dot2Tab1.state = nVal.state; db.SaveChanges(); return(modifyA5dot2Tab1.sbCode); } catch { return("出错!"); } } }
public JsonResult ShuxiangCheck_submitsignal(string json1) { GetNWorkSerManagment gnm = new GetNWorkSerManagment(); JObject item = (JObject)JsonConvert.DeserializeObject(json1); A5dot2Tab1 new_5dot2 = new A5dot2Tab1(); new_5dot2.cjName = item["cjName"].ToString(); new_5dot2.zzName = item["zzName"].ToString(); new_5dot2.sbGyCode = item["sbGyCode"].ToString(); new_5dot2.sbCode = item["sbCode"].ToString(); new_5dot2.sbType = item["sbType"].ToString(); new_5dot2.zyType = item["zyType"].ToString(); new_5dot2.problemDescription = item["problemDescription"].ToString(); new_5dot2.jxSubmitTime = DateTime.Now; new_5dot2.jxUserName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; new_5dot2.isRectified = 0; new_5dot2.state = 0; new_5dot2.temp2 = gnm.AddNWorkEntity("A5dot2").WE_Ser;; bool res = Sx.AddSxItem(new_5dot2); return(Json(new { result = res })); }
public string ZzSubmit_Bcsignal(string json1) { try { JObject item = (JObject)JsonConvert.DeserializeObject(json1); CTimerTimeout timeout_job = new CTimerTimeout(); timeout_job.CreateTime = DateTime.Now; timeout_job.for_using = TIMER_USING.FOR_SYSTEM; timeout_job.mission_name = ""; timeout_job.status = TM_STATUS.TM_STATUS_ACTIVE; timeout_job.SetActionForWF("INVILID"); timeout_job.AttachWFEntityID = Convert.ToInt32(item["wfe_id"]); timeout_job.CustomAction = "http://localhost/CallBack/testCallBack"; timeout_job.EventName = "PqAessess"; timeout_job.SetTriggerTiming("0 0 0 20 * ?"); //保存该定时任务,并将其添加到激活任务列表 timeout_job.Save(); int m_timerMissionID = timeout_job.ID; CTimerManage.AppendMissionToActiveList(timeout_job); // A5dot1Tab1 a5dot1Tab1 = new A5dot1Tab1(); DateTime my = DateTime.Now; int cjid = Em.getEA_parentid(Convert.ToInt32(item["Zz_Id"])); string cjname = Eam.getEa_namebyId(cjid); A5dot2Tab1 new_5dot2 = new A5dot2Tab1(); new_5dot2.cjName = cjname; new_5dot2.zzName = item["Zz_Name"].ToString(); new_5dot2.sbGyCode = item["Equip_GyCode"].ToString(); new_5dot2.sbCode = item["Equip_Code"].ToString(); new_5dot2.sbType = item["Equip_Type"].ToString(); new_5dot2.zyType = item["Zy_Type"].ToString(); new_5dot2.problemDescription = item["problemDescription"].ToString(); new_5dot2.jxSubmitTime = DateTime.Now; new_5dot2.jxUserName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; new_5dot2.isRectified = 0; new_5dot2.state = 0; new_5dot2.temp2 = item["wfe_id"].ToString(); new_5dot2.temp3 = m_timerMissionID.ToString(); bool res = Sx.AddSxItem(new_5dot2); string wfe_id = item["wfe_id"].ToString(); //paras Dictionary <string, string> signal = new Dictionary <string, string>(); signal["ZzSubmit_done"] = "true"; //record Dictionary <string, string> record = new Dictionary <string, string>(); record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(wfe_id), signal, record); } catch (Exception e) { return(""); } return("/A5dot2/Index"); }
public string ModifySxItem1(A5dot2Tab1 add) { return(db_Sxgl.ModifySxRecord1(add)); }
public bool AddSxItem(A5dot2Tab1 add) { return(db_Sxgl.AddSxRecord(add)); }
public Index_ModelforA5dot2 getRecord() { Index_ModelforA5dot2 RecordforA5dot2 = new Index_ModelforA5dot2(); RecordforA5dot2.time = DateTime.Now.ToString(); //ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; RecordforA5dot2.Am = new List <A5dot2Tab1>(); int UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId); if (pv.Role_Names.Contains("检维修人员") || pv.Role_Names.Contains("现场工程师")) { RecordforA5dot2.jwxry = 1; } else { RecordforA5dot2.jwxry = 0; } if (pv.Role_Names.Contains("机动处")) { RecordforA5dot2.jdc = 1; } else { RecordforA5dot2.kxxgcs = 0; } if (pv.Department_Name.Contains("机动处")) { RecordforA5dot2.jdc = 1; } else { RecordforA5dot2.jdc = 0; } if (pv.Role_Names.Contains("可靠性工程师")) { List <string> cjname = new List <string>(); List <Equip_Archi> EA = pm.Get_Person_Cj(UserId); foreach (var ea in EA) { cjname.Add(ea.EA_Name); } List <A5dot2Tab1> miss = Sx.GetSxItem(cjname); foreach (var item in miss) { A5dot2Tab1 a = new A5dot2Tab1(); a.zzName = item.zzName; a.sbGyCode = item.sbGyCode; a.sbCode = item.sbCode; a.jxUserName = item.jxUserName; a.jxSubmitTime = item.jxSubmitTime; a.temp1 = Convert.ToString(miss.IndexOf(item) + 1); a.Id = item.Id; a.temp2 = DateTime.Now.ToString(); RecordforA5dot2.Am.Add(a); } RecordforA5dot2.Hm = new List <A5dot2Tab1>(); // List<A5dot2Tab1> His = Jx.GetHisJxItem(); // foreach (var item in His) // { // A5dot2Tab1 a = new A5dot2Tab1(); // a.Id = item.Id; // a.state = item.state; // // a.temp1 = Convert.ToString(miss.IndexOf(item) + 1); // RecordforA5dot2.Hm.Add(a); // } return(RecordforA5dot2); } return(RecordforA5dot2); }
public JsonResult Pq_submitsignal(string json1) { JObject item = (JObject)JsonConvert.DeserializeObject(json1); A5dot2Tab1 new_5dot21 = new A5dot2Tab1(); new_5dot21.pqCheckTime = DateTime.Now; new_5dot21.pqUserName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; new_5dot21.isRectified = Convert.ToInt32(item["isRectified"]); new_5dot21.state = 1; if (Convert.ToInt32(item["isRectified"]) == 1) { //string[] str = (item["problemDescription"].ToString()).Split(new[] { "(未整改)" }, StringSplitOptions.None);//以字符串作为分割条件 new_5dot21.problemDescription = item["problemDescription"].ToString() + "(已整改)"; } if (Convert.ToInt32(item["isRectified"]) == 0) { new_5dot21.problemDescription = item["problemDescription"].ToString() + "(未整改)"; } new_5dot21.Id = Convert.ToInt32(item["A5dot2Tab1_id"].ToString()); string res = Sx.ModifySxItem(new_5dot21); int a_id = Convert.ToInt32(item["A5dot2Tab1_id"].ToString()); if (Sx.getAllbyid(a_id).temp3 != null) { int missId = Convert.ToInt32(Sx.getAllbyid(a_id).temp3); var t = CTimerManage.LoadTimerMission(missId); if (t != null) { t.status = TM_STATUS.TM_FINISH; t.Save(); CTimerManage.RemoveFromActiveList(t.ID); } } //接收返回的设备工艺号 A5dot2Tab2 new_5dot22 = new A5dot2Tab2(); List <A5dot2Tab2> IsExist = Sx.GetA5dot2Tab2Item(res); if (IsExist.Count == 0) { //传到表2若没有则添加一条数据,如果有则修改该条数据 DateTime i = DateTime.Now; string yearmonth = ""; if (i.Day >= 15) { yearmonth = i.Year.ToString() + "年" + i.AddMonths(1).Month.ToString(); } else { yearmonth = i.Year.ToString() + "年" + i.Month.ToString(); } new_5dot22.cjName = item["cjName"].ToString(); new_5dot22.zzName = item["zzName"].ToString(); new_5dot22.sbGyCode = item["sbGyCode"].ToString(); new_5dot22.sbCode = item["sbCode"].ToString(); new_5dot22.sbType = item["sbType"].ToString(); new_5dot22.zyType = item["zyType"].ToString(); if (Convert.ToInt32(item["isRectified"]) == 1) { new_5dot22.problemDescription = item["problemDescription"].ToString() + "(已整改)"; } if (Convert.ToInt32(item["isRectified"]) == 0) { new_5dot22.problemDescription = item["problemDescription"].ToString() + "(未整改)"; } new_5dot22.state = 1; new_5dot22.nProblemsInCurMonth = 1; new_5dot22.nProblemsInCurYear = 1; new_5dot22.isSetAsTop10Worst = 0; new_5dot22.yearMonthForStatistic = yearmonth; bool has = Sx.AddA5dot2Tab2Item(new_5dot22); } //修改该条数据 else { DateTime i = DateTime.Now; string yearmonth = ""; if (i.Day >= 15) { yearmonth = i.Year.ToString() + "年" + i.AddMonths(1).Month.ToString(); } else { yearmonth = i.Year.ToString() + "年" + i.Month.ToString(); } new_5dot22.cjName = item["cjName"].ToString(); new_5dot22.zzName = item["zzName"].ToString(); new_5dot22.sbGyCode = item["sbGyCode"].ToString(); new_5dot22.sbCode = item["sbCode"].ToString(); new_5dot22.sbType = item["sbType"].ToString(); if (Convert.ToInt32(item["isRectified"]) == 1) { new_5dot22.problemDescription = item["problemDescription"].ToString() + "(已整改)"; } if (Convert.ToInt32(item["isRectified"]) == 0) { new_5dot22.problemDescription = item["problemDescription"].ToString() + "(未整改)"; } new_5dot22.zyType = item["zyType"].ToString(); new_5dot22.sbCode = item["sbCode"].ToString(); new_5dot22.state = 1; new_5dot22.nProblemsInCurMonth = 1; new_5dot22.nProblemsInCurYear = 1; new_5dot22.isSetAsTop10Worst = 0; new_5dot22.yearMonthForStatistic = yearmonth; bool has = Sx.ModifyA5dot2Tab2Item(new_5dot22); } return(Json(new { result = res })); }