// // GET: /UserManager/ public ActionResult Index() { PersonManagment PM = new PersonManagment(); List <Person_Info> r = PM.Get_All_basePersonInfo(); return(View(r)); }
public ActionResult UpdateUser(int userId) { PersonManagment PM = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pm_info = PM.Get_PersonModal(userId); return(View(pm_info)); }
public ActionResult Index(int job_id) { Jobs js = new Jobs(); Timer_Jobs tj = js.GetTimerJob(job_id); string qeendtime = tj.STR_RES_3; if (DateTime.Now < DateTime.Parse(qeendtime)) { ViewBag.zgenable = 1; } else { ViewBag.zgenable = 0; } ViewBag.jobName = tj.job_name; ViewBag.time = tj.STR_RES_2; ViewBag.depts = tj.STR_RES_1; ViewBag.wfe_ids = tj.run_result; 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("可靠性工程师")) { ViewBag.isKkxgcs = "1"; } else { ViewBag.isKkxgcs = "0"; } return(View()); }
public string testgetA14dot3dot4dcl_list(string WorkFlow_Name) { List <A14dot3dot4Model> Am = new List <A14dot3dot4Model>(); A14dot3dot4Model o = new A14dot3dot4Model(); o.index_Id = 1; o.zz_name = "1#常压装置"; o.sb_gycode = "1#常压常一中泵P112A"; o.sb_code = "210000034"; o.sb_type = "150HDS-91"; o.sb_ABCMark = "C"; o.plan_name = "来自DRBPM"; o.jxreason = "就是想检修"; o.xcconfirm = "同意"; o.kkconfirm2 = "同意"; o.zytdconfirm2 = "同意"; o.job_order2 = "23333"; o.notice_order2 = ""; //通过工单号获取通知单号 Q1:会有无法获取通知单号的情况吗,是否允许手动填写 o.missionname = ""; 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); o.role = pv.Role_Names; Am.Add(o); string str = JsonConvert.SerializeObject(Am); return("{" + "\"data\": " + str + "}"); }
public JsonResult List_Roles(string Role_selected) { PersonManagment PM = new PersonManagment(); List <EquipBLL.AdminManagment.PersonManagment.Role_viewModal> role_obj = PM.Get_All_Roles(Role_selected); return(Json(role_obj.ToArray())); }
// GET: /A7dot1/美迅平台数据筛选 public ActionResult MxptSelect(string flowname) { //页面权限,现场工程师能处理 int cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID); ViewBag.user_Role = pv.Role_Names; return(View(getA7dot1MxAlarm_Model())); //2016.6.22 }
public ActionResult EquipQuery() { QueryModal qm = new QueryModal(); qm.wf = CWFEngine.ListAllWFDefine(); PersonManagment pm = new PersonManagment(); qm.UserHasEquips = pm.Get_Person_Cj((Session["User"] as EquipModel.Entities.Person_Info).Person_Id); return(View(qm)); }
public bool submitDeleteUser(int userId) { try { PersonManagment PM = new PersonManagment(); PM.Delete_Person(userId); return(true); } catch { return(false); } }
public ActionResult GraphicData(string wfe_id) { int cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID); ViewBag.user_specis = pv.Speciaty_Names; UI_MISSION miss = CWFEngine.GetActiveMission <Person_Info>(int.Parse(wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext, false); ViewBag.currentMiss = miss; return(View(getWFDetail_Model(wfe_id))); }
public ActionResult Submit() { submitmodel sm = new submitmodel(); ViewBag.curtime = DateTime.Now; ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; int UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); sm.UserHasEquips = pm.Get_Person_Cj((Session["User"] as EquipModel.Entities.Person_Info).Person_Id); return(View(sm)); }
public string LogOn(string userName, string userPwd) { /* PersonManagment pm = new PersonManagment(); * Person_Info p = pm.Get_Person(userName); * if (p == null) * return "Index"; * * else * { * CWFEngine.authority_params["currentuser"] = userName; * Session["User"] = p; * return "/Main/Index0"; * }*/ int a; PersonManagment pm = new PersonManagment(); MD5 md5 = new MD5CryptoServiceProvider(); byte[] result = md5.ComputeHash(System.Text.Encoding.Default.GetBytes(userPwd.Trim())); // pm.ModifyPerson_Pwd(userName, result); Person_Info p = pm.Get_Person(userName); if (p == null) { return("Index"); } else { byte[] r = p.Person_Pwd; string userPwdMD5 = System.Text.UTF8Encoding.Unicode.GetString(result); string userPwDb = System.Text.UTF8Encoding.Unicode.GetString(r); if (!userPwDb.Equals(userPwdMD5)) { return("Index"); } //// string =System.Text.Encoding.Default.GetString(result); else { Dictionary <string, object> dict_authority = new Dictionary <string, object>(); dict_authority["currentuser"] = userName; Session["authority"] = dict_authority; CWFEngine.authority_params = "authority"; Session["User"] = p; return("/Main/Index0"); } } }
// GET: /A7dot2/DRBMP平台数据筛选 public ActionResult DrbpmSelect(string flowname) { //return View(getA7dot2_Model()); //2016.7.25 string strTableName = "SbGyAnalysis"; string strWhere = "1=1";// //页面权限,现场工程师能处理 int cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID); ViewBag.user_Role = pv.Role_Names; return(View(getDRBPM_SbGyAnalysisList(strTableName, strWhere)));//2016.7.25 }
public ActionResult Submit() { submitmodel sm = new submitmodel(); ViewBag.curtime = DateTime.Now; ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; 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("可靠性工程师")) sm.kkxgcs = 1; if (pv.Role_Names.Contains("检维修人员")) sm.jwxry = 1; return View(sm); }
// GET: JobsManagement public ActionResult Index() { 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("专家团队") || pv.Role_Names.Contains("专业团队负责人")) { ViewBag.zytd = 1; } else { ViewBag.zytd = 0; } return(View()); }
public string getA14dot3dot4dcl_list(string WorkFlow_Name) { List <A14dot3dot4Model> Am = new List <A14dot3dot4Model>(); List <A14dot3dot4_ModelInfo> YueduDRBPM = new List <A14dot3dot4_ModelInfo>(); YueduDRBPM = getA14dot3dot4_Model().A14dot3dot4_ModelInfoList; for (int j = 0; j < YueduDRBPM.Count; j++) { A14dot3dot4Model o = new A14dot3dot4Model(); o.index_Id = j + 1; o.zz_name = YueduDRBPM[j].Zz_Name; o.sb_gycode = YueduDRBPM[j].Equip_GyCode; o.sb_code = YueduDRBPM[j].Equip_Code; o.sb_type = YueduDRBPM[j].Equip_Type; o.sb_ABCMark = YueduDRBPM[j].Equip_ABCMark; o.plan_name = "来自DRBPM"; o.jxreason = YueduDRBPM[j].Jx_Reason; o.xcconfirm = "同意"; o.kkconfirm2 = "同意"; o.zytdconfirm2 = "同意"; o.job_order2 = YueduDRBPM[j].Job_Order; o.notice_order2 = "";//通过工单号获取通知单号 Q1:会有无法获取通知单号的情况吗,是否允许手动填写 if (!string.IsNullOrEmpty(YueduDRBPM[j].JxSubmit_done.Trim())) { o.missionname = "已跳转至A8.2"; } else { o.missionname = "审核已完成,工单待填写"; } 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); o.role = pv.Role_Names; Am.Add(o); } string str = JsonConvert.SerializeObject(Am); return("{" + "\"data\": " + str + "}"); }
public ActionResult CaiGouConfirm(string wfe_id) { Dictionary <string, object> paras1 = new Dictionary <string, object>(); paras1["Job_OrderState"] = null; UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(Convert.ToInt32(wfe_id), paras1); ViewBag.Job_OrderState = paras1["Job_OrderState"].ToString(); int cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID); ViewBag.user_Role = pv.Role_Names; ViewBag.user_Depart = pv.Department_Name; UI_MISSION miss = CWFEngine.GetActiveMission <Person_Info>(int.Parse(wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext); ViewBag.currentMiss = miss; return(View(getWFDetail_Model(wfe_id))); }
public string ModifyPWD(string userName, string userPwd, string newUserPWd) { int a; PersonManagment pm = new PersonManagment(); MD5 md5 = new MD5CryptoServiceProvider(); byte[] result = md5.ComputeHash(System.Text.Encoding.Default.GetBytes(userPwd.Trim())); //pm.ModifyPerson_Pwd(userName, result); Person_Info p = pm.Get_Person(userName); if (p == null) { return("ModifyPWD_Index"); } else { byte[] r = p.Person_Pwd; string userPwdMD5 = System.Text.UTF8Encoding.Unicode.GetString(result); string userPwDb = System.Text.UTF8Encoding.Unicode.GetString(r); if (!userPwDb.Equals(userPwdMD5)) { return("ModifyPWD_Index"); } // string =System.Text.Encoding.Default.GetString(result); else { result = md5.ComputeHash(System.Text.Encoding.Default.GetBytes(newUserPWd.Trim())); if (pm.ModifyPerson_Pwd(userName, result)) { return("/Main/Home"); } else { return("ModifyPWD_Index"); } } } }
// GET: /A7dot1dot1/检修单位确认 public ActionResult JxdwConfirm(string wfe_id) { int cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID); ViewBag.user_specis = pv.Speciaty_Names; UI_MISSION miss = CWFEngine.GetActiveMission <Person_Info>(int.Parse(wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext); ViewBag.currentMiss = miss; //由于DongZyConfirm_done 等变量未与该Event关联,所以无法获取, 故而我在下面模拟了这几个变量 //同样的问题也会出现在JxdwConfirm_submitsignal函数中 //WFDetail_Model dfm = getWFDetail_Model(wfe_id); //dfm.ALLHistoryMiss.Last().Miss_Params["DongZyConfirm_done"] = true.ToString(); //dfm.ALLHistoryMiss.Last().Miss_Params["DongZyMan"] = "fhp"; //dfm.ALLHistoryMiss.Last().Miss_Params["DianZyConfirm_done"] = false.ToString(); //dfm.ALLHistoryMiss.Last().Miss_Params["DianZyMan"] = ""; //dfm.ALLHistoryMiss.Last().Miss_Params["YiZyConfirm_done"] = false.ToString(); //dfm.ALLHistoryMiss.Last().Miss_Params["YiZyMan"] = ""; return(View(getWFDetail_Model(wfe_id))); //return View(dfm); }
public string submitsignal(string json1) { try { JObject item = (JObject)JsonConvert.DeserializeObject(json1); PersonManagment pm = new PersonManagment(); string workflow = item["WorkFlow"].ToString(); string[] member = item["Member"].ToString().Split(new char[] { ',' }); for (int i = 0; i < member.Length; i++) { int pid = pm.GetPersonId(member[i]); int mid = pm.GetMenuId(workflow); bool res = pm.AddPW(pid, mid); } //bool ress = pm.AddPW(Convert.ToInt32(item["personid"].ToString()), Convert.ToInt32(item["menuid"].ToString())); } catch (Exception e) { return(""); } return("/PersonAndWorkflows/Index"); }
public ActionResult Index0() { if (Session["User"] == null) { Response.Redirect("/Login/chaoshi"); return(View()); } else { getIndexmodel model = new getIndexmodel(); model.mt = menuconfig.BuildMenuList(); model.username = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; model.userid = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment PM = new PersonManagment(); EquipBLL.AdminManagment.PersonManagment.P_viewModal pm_info = PM.Get_PersonModal(model.userid); model.belong_depart = pm_info.Department_Name; model.isManager = PM.is_Role_admin(model.username); //int a = mt.Count(); return(View(model)); } }
public Index_ModelforA15 getRecord_detail(string id) { Index_ModelforA15 RecordforA15 = new Index_ModelforA15(); RecordforA15.Am = new List <A15dot1TabQiYe>(); RecordforA15.Hm = new List <A15dot1TabQiYe>(); ViewBag.curtime = DateTime.Now.ToString(); ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; int IntId = Convert.ToInt32(id); List <A15dot1TabQiYe> miss = Jx.GetJxItem_detail(IntId); foreach (var item in miss) { A15dot1TabQiYe a = new A15dot1TabQiYe(); a.zzkkxzs = item.zzkkxzs; a.wxfyzs = item.wxfyzs; a.qtlxbmfxhl = item.qtlxbmfxhl; a.qtlhsbgsghl = item.qtlhsbgsghl; a.ybsjkzl = item.ybsjkzl; a.sjs = item.sjs; a.gzqdkf = item.gzqdkf; a.xmyql = item.xmyql; a.pxjnl = item.pxjnl; a.submitDepartment = item.submitDepartment; a.submitUser = item.submitUser; a.submitTime = item.submitTime; a.jdcOperator = item.jdcOperator; a.jdcOperateTime = item.jdcOperateTime; a.reportType = item.reportType; a.temp1 = Convert.ToString(miss.IndexOf(item) + 1); a.submitUser = item.submitUser; a.submitTime = item.submitTime; a.state = item.state; a.temp3 = item.temp3; a.reliabilityConclusion = item.reliabilityConclusion; a.Id = item.Id; RecordforA15.Am.Add(a); } string name = RecordforA15.Am[0].submitUser; PersonManagment pm = new PersonManagment(); int UserId = pm.Get_Person(name).Person_Id; EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId); if (pv.Role_Names.Contains("可靠性工程师")) { RecordforA15.am = 1; } else { RecordforA15.am = 0; } List <A15dot1TabQiYe> His = Jx.GetHisJxItem_detail(IntId); foreach (var item in His) { A15dot1TabQiYe a = new A15dot1TabQiYe(); a.zzkkxzs = item.zzkkxzs; a.wxfyzs = item.wxfyzs; a.qtlxbmfxhl = item.qtlxbmfxhl; a.qtlhsbgsghl = item.qtlhsbgsghl; a.ybsjkzl = item.ybsjkzl; a.sjs = item.sjs; a.gzqdkf = item.gzqdkf; a.xmyql = item.xmyql; a.pxjnl = item.pxjnl; a.submitDepartment = item.submitDepartment; a.submitUser = item.submitUser; a.submitTime = item.submitTime; a.jdcOperator = item.jdcOperator; a.jdcOperateTime = item.jdcOperateTime; a.reportType = item.reportType; a.temp1 = Convert.ToString(miss.IndexOf(item) + 1); a.submitUser = item.submitUser; a.submitTime = item.submitTime; a.state = item.state; a.Id = item.Id; RecordforA15.Hm.Add(a); } name = RecordforA15.Hm[0].submitUser; UserId = pm.Get_Person(name).Person_Id; pv = pm.Get_PersonModal(UserId); if (pv.Role_Names.Contains("可靠性工程师")) { RecordforA15.hm = 1; } else { RecordforA15.hm = 0; } return(RecordforA15); }
private DtResponse ProcessRequest(List <KeyValuePair <string, string> > data) { DtResponse dt = new DtResponse(); var http = DtRequest.HttpData(data); var Data = http["data"] as Dictionary <string, object>; int wfe_id = -1; foreach (var d in Data) { wfe_id = Convert.ToInt32(d.Key); } string jx_reason = ""; string E_code = ""; string job_order = ""; string notice_order = ""; foreach (var d in Data) { int id = Convert.ToInt32(d.Key); foreach (var dd in d.Value as Dictionary <string, object> ) { ERPInfoManagement erp = new ERPInfoManagement(); //sb_code、jxreason与设备绑定在一起传过来,当通知单号工单号填完后满足向A8.2跳转条件 if (dd.Key == "sb_code") { E_code = dd.Value.ToString(); } if (dd.Key == "jxreason") { jx_reason = dd.Value.ToString(); } if (dd.Key == "notice_order2") { if (dd.Value.ToString() == "") { continue; } notice_order = "00" + dd.Value.ToString(); GD_InfoModal res = erp.getGD_Modal_Notice(notice_order); if (res != null) { job_order = res.GD_Id; } } if (dd.Key == "job_order2") { if (dd.Value.ToString() == "") { continue; } job_order = "00" + dd.Value.ToString(); GD_InfoModal res = erp.getGD_Modal_GDId(job_order); if (res != null) { notice_order = res.GD_Notice_Id; } } //if (dd.Key == "JumpA8dot2DR") //{ // string Equip_Code = E_code; // string Jx_Reason = jx_reason; // string flowname = "A8dot2"; // UI_WorkFlow_Entity wfe = CWFEngine.CreateAWFEntityByName(flowname); // if (wfe != null) // { // EquipManagment em = new EquipManagment(); // Equip_Info eqinfo = em.getEquip_Info(Equip_Code); // List<Equip_Archi> Equip_ZzBelong = em.getEquip_ZzBelong(eqinfo.Equip_Id); // Dictionary<string, string> record = wfe.GetRecordItems(); // record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; // record["time"] = DateTime.Now.ToString(); // wfe.Start(record); // int flow_id = wfe.EntityID; // //paras // Dictionary<string, string> signal = new Dictionary<string, string>(); // signal["JxSubmit_done"] = "true"; // signal["Cj_Name"] = Equip_ZzBelong[1].EA_Name; //Cj_Name // signal["Zz_Name"] = Equip_ZzBelong[0].EA_Name; //Zz_Name // signal["Equip_GyCode"] = eqinfo.Equip_GyCode; // signal["Equip_Code"] = eqinfo.Equip_Code; // signal["Equip_Type"] = eqinfo.Equip_Type; // signal["Zy_Type"] = eqinfo.Equip_Specialty; // signal["Zy_SubType"] = eqinfo.Equip_PhaseB; // signal["Equip_ABCMark"] = eqinfo.Equip_ABCmark; // signal["Jx_Reason"] = Jx_Reason;//计划检修原因 PM? // signal["Job_Name"] = "来自DRBPM"; // signal["Job_Order"] = job_order; // //record // record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; // record["time"] = DateTime.Now.ToString(); // //submit // CWFEngine.SubmitSignal(flow_id, signal, record); // } //} } } Dictionary <string, object> m_kv = new Dictionary <string, object>(); EquipManagment em1 = new EquipManagment(); Equip_Info eqinfo1 = em1.getEquip_Info(E_code); List <Equip_Archi> Equip_ZzBelong1 = em1.getEquip_ZzBelong(eqinfo1.Equip_Id); 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); m_kv["index_Id"] = wfe_id; m_kv["zz_name"] = Equip_ZzBelong1[0].EA_Name; //Zz_Name m_kv["sb_gycode"] = eqinfo1.Equip_GyCode; m_kv["sb_code"] = E_code; m_kv["sb_type"] = eqinfo1.Equip_Type; m_kv["sb_ABCMark"] = eqinfo1.Equip_ABCmark; m_kv["plan_name"] = "来自DRBPM"; m_kv["jxreason"] = jx_reason; m_kv["kkconfirm2"] = "同意"; m_kv["zytdconfirm2"] = "同意"; m_kv["job_order2"] = job_order; m_kv["notice_order2"] = notice_order; m_kv["missionname"] = "完善工单与通知单后跳转"; m_kv["role"] = pv.Role_Names; dt.data.Add(m_kv); return(dt); }
public Index_ModelforA15 getRecord() { Index_ModelforA15 RecordforA15 = new Index_ModelforA15(); //ViewBag.curtime = DateTime.Now.ToString(); 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); RecordforA15.Am=new List<A15dot1Tab>(); if (pv.Role_Names.Contains("可靠性工程师") || pv.Role_Names.Contains("检维修人员")) RecordforA15.isSubmit = 1; else RecordforA15.isSubmit = 0; if (pv.Role_Names.Contains("可靠性工程师")) RecordforA15.kkxgcs = 1; else RecordforA15.kkxgcs = 0; 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<A15dot1Tab> miss = Jx.GetJxItem(pv.Role_Names,pv.Department_Name,pv.Person_Name); foreach (var item in miss) { A15dot1Tab a = new A15dot1Tab(); a.timesNonPlanStop = item.timesNonPlanStop; a.scoreDeductFaultIntensity = item.scoreDeductFaultIntensity; a.rateBigUnitFault = item.rateBigUnitFault; a.rateFaultMaintenance = item.rateFaultMaintenance; a.MTBF = item.MTBF; a.rateEquipUse = item.rateEquipUse; a.rateUrgentRepairWorkHour = item.rateUrgentRepairWorkHour; a.hourWorkOrderFinish = item.hourWorkOrderFinish; a.avgLifeSpanSeal = item.avgLifeSpanSeal; a.avgLifeSpanAxle = item.avgLifeSpanAxle; a.percentEquipAvailability = item.percentEquipAvailability; a.percentPassOnetimeRepair = item.percentPassOnetimeRepair; a.avgEfficiencyPump = item.avgEfficiencyPump; a.avgEfficiencyUnit = item.avgEfficiencyUnit; a.hiddenDangerInvestigation = item.hiddenDangerInvestigation; a.rateLoad = item.rateLoad; a.gyChange = item.gyChange; a.equipChange = item.equipChange; a.otherDescription = item.otherDescription; a.evaluateEquipRunStaeDesc = item.evaluateEquipRunStaeDesc; a.evaluateEquipRunStaeImgPath = item.evaluateEquipRunStaeImgPath; a.reliabilityConclusion = item.reliabilityConclusion; a.jdcAdviseImproveMeasures = item.jdcAdviseImproveMeasures; a.submitDepartment = item.submitDepartment; a.submitUser = item.submitUser; a.submitTime = item.submitTime; a.jdcOperator = item.jdcOperator; a.jdcOperateTime = item.jdcOperateTime; a.reportType = item.reportType; a.temp1 = Convert.ToString(miss.IndexOf(item) + 1); a.submitUser = item.submitUser; a.submitTime = item.submitTime; a.state = item.state; a.Id = item.Id; RecordforA15.Am.Add(a); } RecordforA15.Hm = new List<A15dot1Tab>(); List<A15dot1Tab> His = Jx.GetHisJxItem(pv.Role_Names, pv.Department_Name, pv.Person_Name); foreach (var item in His) { A15dot1Tab a = new A15dot1Tab(); a.Id = item.Id; a.state = item.state; a.jdcOperateTime = item.jdcOperateTime; a.jdcOperator = item.jdcOperator; a.temp1 = Convert.ToString(His.IndexOf(item) + 1); RecordforA15.Hm.Add(a); } return RecordforA15; }
public string submitNewUser(string json1) { try { SpeciatyManagment SM = new SpeciatyManagment(); PersonManagment PM = new PersonManagment(); Person_Info newP = new Person_Info(); JObject item = (JObject)JsonConvert.DeserializeObject(json1); newP.Person_Name = item["UserName"].ToString(); /*0710添加*/ var pwd = item["UserPwd"].ToString(); MD5 md5 = new MD5CryptoServiceProvider(); byte[] result = md5.ComputeHash(System.Text.Encoding.Default.GetBytes(pwd.Trim())); newP.Person_Pwd = result; /*0710end*/ newP.Person_tel = item["UserTel"].ToString(); newP.Person_mail = item["UserMail"].ToString(); var equipArchiStr = item["UserEquipArchiSel"].ToString(); var roleStr = item["UserRole"].ToString(); var speciatyStr = item["UserSpeciatySel"].ToString(); var MenuStr = item["UserMenus"].ToString(); int Depart_id = Convert.ToInt32(item["UserDepartId"].ToString()); List <int> EquipArchiList = new List <int>(); if (equipArchiStr != "") { string[] s = equipArchiStr.Split(new char[] { ',' }); for (int i = 0; i < s.Length; i++) { EquipArchiList.Add(Convert.ToInt32(s[i])); } } /* List<int> SpeciatyList = new List<int>(); * if (speciatyStr != "") * { * string[] s = speciatyStr.Split(new char[] { ',' }); * for (int i = 0; i < s.Length; i++) * { SpeciatyList.Add(Convert.ToInt32(s[i])); } * }*/ List <int> SpeciatyList = new List <int>(); if (speciatyStr != "") { string[] s = speciatyStr.Split(new char[] { ',' }); for (int i = 0; i < s.Length; i++) { int id = Convert.ToInt16(s[i]); List <Speciaty_Info> r = SM.GetChildsspecialty(id); if (r == null) { if (SpeciatyList.Where(x => x == id).Count() == 0) { SpeciatyList.Add(Convert.ToInt32(s[i])); } } else { if (SpeciatyList.Where(x => x == id).Count() == 0) { SpeciatyList.Add(Convert.ToInt32(s[i])); } foreach (var t in r) { if (SpeciatyList.Where(x => x == t.Specialty_Id).Count() == 0) { SpeciatyList.Add(Convert.ToInt32(t.Specialty_Id)); } } } } } List <int> MenuList = new List <int>(); if (MenuStr != "") { string[] s1 = MenuStr.Split(new char[] { ',' }); for (int i = 0; i < s1.Length; i++) { MenuList.Add(Convert.ToInt32(s1[i])); } } List <int> RoleList = new List <int>(); if (roleStr != "") { string[] s2 = roleStr.Split(new char[] { ',' }); for (int i = 0; i < s2.Length; i++) { RoleList.Add(Convert.ToInt32(s2[i])); } } PM.Add_Person(newP, Depart_id, RoleList, EquipArchiList, SpeciatyList, MenuList); //保存基础信息 return("保存成功!"); } catch { return(""); }; }
public string submitUpdateUser(string json1) { try { SpeciatyManagment SM = new SpeciatyManagment(); PersonManagment PM = new PersonManagment(); Person_Info newP = new Person_Info(); JObject item = (JObject)JsonConvert.DeserializeObject(json1); newP.Person_Id = Convert.ToInt32(item["UserId"].ToString()); newP.Person_Name = item["UserName"].ToString(); newP.Person_tel = item["UserTel"].ToString(); newP.Person_mail = item["UserMail"].ToString(); var roleStr = item["UserRole"].ToString(); var speciatyStr = item["UserSpeciatySel"].ToString(); var MenuStr = item["UserMenus"].ToString(); var equipArchiStr = item["UserEquipArchiSel"].ToString(); int Depart_id = Convert.ToInt32(item["UserDepartId"].ToString()); List <int> EquipArchiList = new List <int>(); if (equipArchiStr != "") { string[] s = equipArchiStr.Split(new char[] { ',' }); for (int i = 0; i < s.Length; i++) { EquipArchiList.Add(Convert.ToInt32(s[i])); } } /* List<int> SpeciatyList = new List<int>(); * if (speciatyStr != "") * { * string[] s = speciatyStr.Split(new char[] { ',' }); * for (int i = 0; i < s.Length; i++) * { SpeciatyList.Add(Convert.ToInt32(s[i])); } * }*/ List <int> SpeciatyList = new List <int>(); if (speciatyStr != "") { string[] s = speciatyStr.Split(new char[] { ',' }); for (int i = 0; i < s.Length; i++) { int id = Convert.ToInt16(s[i]); List <Speciaty_Info> r = SM.GetChildsspecialty(id); if (r == null) { if (SpeciatyList.Where(x => x == id).Count() == 0) { SpeciatyList.Add(Convert.ToInt32(s[i])); } } else { if (SpeciatyList.Where(x => x == id).Count() == 0) { SpeciatyList.Add(Convert.ToInt32(s[i])); } foreach (var t in r) { if (SpeciatyList.Where(x => x == t.Specialty_Id).Count() == 0) { SpeciatyList.Add(Convert.ToInt32(t.Specialty_Id)); } } } } } List <int> MenuList = new List <int>(); if (MenuStr != "") { string[] s1 = MenuStr.Split(new char[] { ',' }); for (int i = 0; i < s1.Length; i++) { MenuList.Add(Convert.ToInt32(s1[i])); } } List <int> RoleList = new List <int>(); if (roleStr != "") { string[] s2 = roleStr.Split(new char[] { ',' }); for (int i = 0; i < s2.Length; i++) { RoleList.Add(Convert.ToInt32(s2[i])); } } PM.Update_Person(newP, Depart_id, RoleList, EquipArchiList, SpeciatyList, MenuList); //保存基础信息 return("用户信息修改成功!"); } catch { return(""); }; }
public ActionResult Home() { homemodel hm = new homemodel(); hm.userName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name.ToString(); hm.userId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id; PersonManagment pm = new PersonManagment(); //string cj = pm.Get_Person_Cj(hm.userId).First().EA_Name; string cj = "联合一车间"; EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(hm.userId); QEntranceManagment qem = new QEntranceManagment(); List <Quick_Entrance> qe = qem.GetQ_EbyP_Id(hm.userId); hm.q_cunzai = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; if (qe != null) { foreach (var q in qe) { hm.q_cunzai[q.xuhao - 1] = 1; } } //if (pv.Role_Names == "现场工程师") if (pv.Role_Names.Contains("现场工程师")) { DateTime now = DateTime.Now; DateTime LastThursday = now; DateTime Day20 = now; string a = now.DayOfWeek.ToString("d"); if (a == "1") { LastThursday = now.AddDays(-4).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second); } if (a == "2") { LastThursday = now.AddDays(-5).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second); } if (a == "3") { LastThursday = now.AddDays(-6).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second); } if (a == "4") { LastThursday = now.AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second); } if (a == "5") { LastThursday = now.AddDays(-1).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second); } if (a == "6") { LastThursday = now.AddDays(-2).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second); } if (a == "0") { LastThursday = now.AddDays(-3).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second); } if (now.Day >= 20) { Day20 = now.AddDays(20 - now.Day).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second); string query_list1 = "E.WE_Ser,R.time"; string query_condition1 = " P.Cj_Name ='" + cj + "' and E.W_Name='A6dot2' and M.Miss_Name ='Xc_Sample' "; string record_filter1 = "Convert(datetime,time)>'" + Day20.ToString() + "' and Convert(datetime,time)<'" + now.ToString() + "'"; DataTable dt1 = CWFEngine.QueryAllInformation(query_list1, query_condition1, record_filter1); if (dt1.Rows.Count != 0) { hm.A6dot2Isdone = "false"; } else { hm.A6dot2Isdone = "true"; } } else { hm.A6dot2Isdone = "false"; } string query_list = "E.WE_Ser,R.time"; string query_condition = " P.Cj_Name ='" + cj + "' and E.W_Name='A7dot1dot1'"; string record_filter = "Convert(datetime,time)>'" + LastThursday.ToString() + "' and Convert(datetime,time)<'" + now.ToString() + "'"; DataTable dt = CWFEngine.QueryAllInformation(query_list, query_condition, record_filter); if (dt != null) { if (dt.Rows.Count != 0) { hm.A7dot1Isdone = "true"; } else { hm.A7dot1Isdone = "false"; } } } else { hm.A7dot1Isdone = "true"; } //注:这里判断的是部门为设监中心的 if (pv.Department_Name.Contains("设监中心")) { DateTime now = DateTime.Now; DateTime Day27 = now; if (now.Day >= 27) { Day27 = now.AddDays(27 - now.Day).AddHours(-now.Hour).AddMinutes(-now.Minute).AddSeconds(-now.Second); string query_list1 = "E.WE_Ser,R.time"; string query_condition1 = "E.W_Name='A6dot2' and M.Miss_Name ='Sj_Result' "; string record_filter1 = "Convert(datetime,time)>'" + Day27.ToString() + "' and Convert(datetime,time)<'" + now.ToString() + "'"; DataTable dt1 = CWFEngine.QueryAllInformation(query_list1, query_condition1, record_filter1); if (dt1.Rows.Count != 0) { hm.A6dot2SjFile = "false"; } else { hm.A6dot2SjFile = "true"; } } else { hm.A6dot2SjFile = "false"; } } else { hm.A6dot2SjFile = "false"; } return(View(hm)); }
//zxh public string ListMission_zxh() { try { IObjectContextAdapter IOca = new EquipWebContext(); List <UI_MISSION> miss = CWFEngine.GetActiveMissions <Person_Info>(IOca.ObjectContext); List <Object> miss_obj = new List <object>(); string userName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name.ToString(); foreach (UI_MISSION item in miss) { MainMissionsModel mm = GetMainMissionsInfo(item.WE_Entity_Id); Jobs js = new Jobs(); string endtime = ""; string lsh_xy = "1"; if (js.GetDSnexttime(mm.jobname, item.WE_Entity_Id) != null) { if (js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).PreTime == null) { string end_corn = js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).corn_express; TriggerTiming TT = new TriggerTiming(); TT.FromString(end_corn); TT.RefreshNextTiming(DateTime.Now); endtime = TT.NextTiming.ToString(); } else { endtime = js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).PreTime.ToString(); } } if (mm.Equip_GyCode == null || mm.Equip_GyCode == "") { lsh_xy = "0"; } object o = new { WF_ICON = "fa fa-flash text-text-aqua", MISS_Url = item.Mission_Url, WF_Name = mm.WF_Name, MISS_Name = item.WE_Event_Desc, wfe_serial = mm.wfe_serial, sbCode = mm.Equip_GyCode, time = mm.time, endtime = endtime, lsh_xy = lsh_xy }; EquipManagment em = new EquipManagment(); if (mm.WF_Name.Contains("定时KPI月报")) { if (userName == "龚海桥" && mm.WF_Name.Contains("联合一片区")) { miss_obj.Add(o); } else if (userName == "丁一刚" && mm.WF_Name.Contains("联合二片区")) { miss_obj.Add(o); } else if (userName == "邓杰" && (mm.WF_Name.Contains("联合三片区") || mm.WF_Name.Contains("化工片区"))) { miss_obj.Add(o); } else if (userName == "杨书毅" && mm.WF_Name.Contains("联合四片区")) { miss_obj.Add(o); } else if (userName == "武文斌" && (mm.WF_Name.Contains("综合片区") || mm.WF_Name.Contains("系统片区"))) { miss_obj.Add(o); } } else { if (userName == "sa" || userName == "程聂") { miss_obj.Add(o); } else { if (lsh_xy == "1") { if (em.getEquip_ByGyCode(mm.Equip_GyCode).Equip_Specialty == "动") { miss_obj.Add(o); } } else { miss_obj.Add(o); } } } } TablesManagment tm = new TablesManagment(); 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("可靠性工程师")) { string wfe_ser = ""; 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 <A5dot1Tab1> E = tm.Getdcl_listbyisZG(0, cjname); for (int i = 0; i < E.Count; i++) { if (E[i].dataSource != null) { wfe_ser = E[i].dataSource; } object o = new { WF_ICON = "fa fa-flash text-text-aqua", MISS_Url = "/A5dot1/Index", WF_Name = "设备完好", MISS_Name = "可靠性工程师确认整改", wfe_serial = wfe_ser, sbCode = E[i].sbGyCode.ToString(), time = E[i].zzSubmitTime.ToString(), endtime = "", lsh_xy = 1 }; miss_obj.Add(o); } SxglManagment Sx = new SxglManagment(); List <A5dot2Tab1> EE = Sx.GetSxItem(cjname); foreach (var item in EE) { if (item.temp2 != null) { wfe_ser = item.temp2; } object o = new { WF_ICON = "fa fa-flash text-text-aqua", MISS_Url = "/A5dot2/Index", WF_Name = "竖向问题", MISS_Name = "可靠性工程师确认整改", wfe_serial = wfe_ser, sbCode = item.sbGyCode.ToString(), time = item.jxSubmitTime.ToString(), endtime = "", lsh_xy = 1 }; miss_obj.Add(o); } } string str = JsonConvert.SerializeObject(miss_obj); return("{" + "\"data\": " + str + "}"); } catch (Exception e) { return(null); } }
private DtResponse ProcessRequest(List <KeyValuePair <string, string> > data) { DtResponse dt = new DtResponse(); var http = DtRequest.HttpData(data); var Data = http["data"] as Dictionary <string, object>; int wfe_id = -1; foreach (var d in Data) { wfe_id = Convert.ToInt32(d.Key); } foreach (var d in Data) { int id = Convert.ToInt32(d.Key); foreach (var dd in d.Value as Dictionary <string, object> ) { ERPInfoManagement erp = new ERPInfoManagement(); Dictionary <string, string> signal = new Dictionary <string, string>(); if (dd.Key == "plan_name") { signal["Plan_Name"] = dd.Value.ToString(); //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "jxreason") { signal["JxCauseDesc"] = dd.Value.ToString(); signal["CompleteNameReason_Done"] = "true"; //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "xcconfirm") { string[] result = dd.Value.ToString().Split(new char[] { '$' }); signal["XcConfirm_Result"] = result[0]; if (result.Length > 1) { signal["XcConfirm_Reason"] = result[1]; } //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "kkconfirm") { if (dd.Value.ToString() == "") { continue; } string[] result = dd.Value.ToString().Split(new char[] { '$' }); signal["KkConfirm_Result"] = result[0]; if (result.Length > 1) { signal["KkConfirm_Reason"] = result[1]; } //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "zytdconfirm") { if (dd.Value.ToString() == "") { continue; } string[] result = dd.Value.ToString().Split(new char[] { '$' }); signal["ZytdConfirm_Result"] = result[0]; if (result.Length > 1) { signal["ZytdConfirm_Reason"] = result[1]; } //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "notice_order") { if (dd.Value.ToString() == "") { continue; } signal["NoticeOrder"] = "00" + dd.Value.ToString(); GD_InfoModal res = erp.getGD_Modal_Notice("00" + dd.Value.ToString()); if (res != null) { signal["JobOrder"] = res.GD_Id; } //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } if (dd.Key == "job_order") { if (dd.Value.ToString() == "") { continue; } signal["JobOrder"] = "00" + dd.Value.ToString(); GD_InfoModal res = erp.getGD_Modal_GDId("00" + dd.Value.ToString()); if (res != null) { signal["NoticeOrder"] = res.GD_Notice_Id; } //record Dictionary <string, string> record1 = new Dictionary <string, string>(); record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; record1["time"] = DateTime.Now.ToString(); //submit CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); } //if (dd.Key == "JumpA8dot2T") //{ // //补充跳转A8dot2的变量,Cj_Name,Zy_Type,Zy_SubType // Dictionary<string, object> paras1 = new Dictionary<string, object>(); // paras1["Zz_Name"] = null; // paras1["Equip_GyCode"] = null; // paras1["Equip_Code"] = null; // paras1["Plan_Name"] = null; // UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(id, paras1); // //获取设备专业类别和子类别及设备所属车间 // EquipManagment tm = new EquipManagment(); // Equip_Info getZy = tm.getEquip_ByGyCode(paras1["Equip_GyCode"].ToString()); // signal["Zy_Type"] = getZy.Equip_Specialty; // signal["Zy_SubType"] = getZy.Equip_PhaseB; // signal["Equip_Type"] = getZy.Equip_Type; // //EA_Name_EA_Id= tm.getEquip(paras1["Zz_Name"].ToString()).EA_Parent.EA_Id; // signal["Cj_Name"] = tm.getEquip(paras1["Zz_Name"].ToString()); // signal["Plan_Name"] = paras1["Plan_Name"].ToString(); // signal["JxdwAttachPlanOrder_Done"] = dd.Value.ToString(); // //record // Dictionary<string, string> record1 = new Dictionary<string, string>(); // record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; // record1["time"] = DateTime.Now.ToString(); // //submit // CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1); //} } } Dictionary <string, object> paras = new Dictionary <string, object>(); paras["Zz_Name"] = null; paras["Equip_GyCode"] = null; paras["Equip_Code"] = null; paras["Equip_Type"] = null; paras["Equip_ABCMark"] = null; paras["Plan_Name"] = null; paras["JxCauseDesc"] = null; paras["XcConfirm_Result"] = null; paras["KkConfirm_Result"] = null; paras["ZytdConfirm_Result"] = null; paras["JobOrder"] = null; paras["NoticeOrder"] = null; if (wfe_id != -1) { WorkFlows wfsd = new WorkFlows(); UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(wfe_id, paras); Dictionary <string, object> m_kv = new Dictionary <string, object>(); Mission db_miss = wfsd.GetWFEntityMissions(wfe_id).Last();//获取该实体最后一个任务 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); m_kv["index_Id"] = wfe_id; m_kv["zz_name"] = paras["Zz_Name"].ToString(); m_kv["sb_gycode"] = paras["Equip_GyCode"].ToString(); m_kv["sb_code"] = paras["Equip_Code"].ToString(); m_kv["sb_type"] = paras["Equip_Type"].ToString(); m_kv["sb_ABCMark"] = paras["Equip_ABCMark"].ToString(); m_kv["plan_name"] = paras["Plan_Name"].ToString(); m_kv["jxreason"] = paras["JxCauseDesc"].ToString(); m_kv["xcconfirm"] = paras["XcConfirm_Result"].ToString(); m_kv["kkconfirm"] = paras["KkConfirm_Result"].ToString(); m_kv["zytdconfirm"] = paras["ZytdConfirm_Result"].ToString(); m_kv["job_order"] = paras["JobOrder"].ToString(); m_kv["notice_order"] = paras["NoticeOrder"].ToString(); m_kv["missionname"] = db_miss.Miss_Desc; m_kv["role"] = pv.Role_Names; dt.data.Add(m_kv); } return(dt); }
/// <summary> /// 有以前的通过Excel表读取数据模式改为现在的直接读取ERP中数据,通过周期调用此函数,周期存库 /// </summary> /// <param name="json1"></param> /// <returns></returns> public void ERPSubmit() { try { PersonManagment PM = new PersonManagment(); A6dot2Managment WM = new A6dot2Managment(); A6dot2Tab1 WDT_list = new A6dot2Tab1(); ERPInfoManagement erp = new ERPInfoManagement(); EquipManagment EM = new EquipManagment(); string EquipPhaseB; WDT_list.uploadDesc = ""; //字段保留,(以前用于上传五定表的描述) WDT_list.uuploadFileName = ""; //字段保留,(以前用于上传五定表的名字) //string[] savedFileName = WDT_list.uuploadFileName.Split(new char[] { '$' }); //string wdt_filename = Path.Combine(Request.MapPath("~/Upload"), savedFileName[1]);//没有用到的变量 //WDT_list.userName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; WDT_list.userName = "******"; WDT_list.uploadtime = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"); //WDT_list.pqName = PM.Get_Person_Depart((Session["User"] as EquipModel.Entities.Person_Info).Person_Id).Depart_Name; WDT_list.pqName = "待定"; int WDT_ID = WM.add_WDT_list(WDT_list); List <OilInfo> OilInfo_Overdue = erp.getOilInfo_overdue(); List <A6dot2Tab2> wdt_list = new List <A6dot2Tab2>(); foreach (var i in OilInfo_Overdue) { A6dot2Tab2 tmp = new A6dot2Tab2(); tmp.isValid = 1; tmp.equipCode = i.oil_EquipCode; tmp.equipDesc = i.oil_EquipDesc; tmp.funLoc = i.oil_Fun_Loc; tmp.funLoc_desc = i.oil_Fun_LocDesc; tmp.oilLoc = i.oil_Loc; tmp.oilLoc_desc = i.oil_Loc; tmp.oilInterval = Convert.ToInt32(i.oil_Interval); tmp.unit = i.oil_Unit; tmp.lastOilTime = i.oil_LastDate; tmp.lastOilNumber = Convert.ToDouble(i.oil_LastNum); tmp.lastOilUnit = i.oil_Unit; tmp.NextOilTime = i.oil_NextDate.ToString(); tmp.NextOilNumber = Convert.ToDouble(i.oil_NextNum); tmp.NextOilUnit = i.oil_Unit2; tmp.oilCode = i.oil_Code; tmp.oilCode_desc = i.oil_Desc; tmp.substiOilCode = ""; tmp.substiOilCode_desc = ""; if (EM.getEquip_Info(tmp.equipCode) != null) { EquipPhaseB = EM.getEquip_Info(tmp.equipCode).Equip_PhaseB; if (EquipPhaseB == null) { tmp.isOilType = 0; } else { if (EquipPhaseB.Equals("机泵") || EquipPhaseB.Equals("风机")) { tmp.isOilType = 1; } else { tmp.isOilType = 0; } } List <Equip_Archi> ZzCj = EM.getEquip_ZzBelong(EM.getEquip_Info(tmp.equipCode).Equip_Id); tmp.equip_ZzName = ZzCj.First().EA_Name; tmp.equip_CjName = ZzCj.Last().EA_Name; tmp.equip_PqName = EM.GetPqofZz(tmp.equip_ZzName).Pq_Name; } tmp.isExceed = 1; tmp.Tab1_Id = WDT_ID; wdt_list.Add(tmp); } WM.add_WDT_content(WDT_ID, wdt_list); /* foreach(var i in wdt_content) * { * return i.equip_CjName; * } * */ // return "/A6dot2/Index_Tj"; } catch { } }
public Index_ModelforA15 getRecord() { Index_ModelforA15 RecordforA15 = new Index_ModelforA15(); //ViewBag.curtime = DateTime.Now.ToString(); 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); RecordforA15.Am = new List <A15dot1TabQiYe>(); if (pv.Role_Names.Contains("可靠性工程师") || pv.Role_Names.Contains("检维修人员")) { RecordforA15.isSubmit = 1; } else { RecordforA15.isSubmit = 0; } if (pv.Role_Names.Contains("可靠性工程师")) { RecordforA15.kkxgcs = 1; } else { RecordforA15.kkxgcs = 0; } 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 <A15dot1TabQiYe> miss = Jx.GetJxItem(pv.Role_Names, pv.Department_Name, pv.Person_Name, cjname); foreach (var item in miss) { A15dot1TabQiYe a = new A15dot1TabQiYe(); a.zzkkxzs = item.zzkkxzs; a.wxfyzs = item.wxfyzs; a.qtlxbmfxhl = item.qtlxbmfxhl; a.qtlhsbgsghl = item.qtlhsbgsghl; a.ybsjkzl = item.ybsjkzl; a.sjs = item.sjs; a.gzqdkf = item.gzqdkf; a.xmyql = item.xmyql; a.pxjnl = item.pxjnl; a.submitDepartment = item.submitDepartment; a.submitUser = item.submitUser; a.submitTime = item.submitTime; a.jdcOperator = item.jdcOperator; a.jdcOperateTime = item.jdcOperateTime; a.reportType = item.reportType; a.temp1 = Convert.ToString(miss.IndexOf(item) + 1); a.submitUser = item.submitUser; a.submitTime = item.submitTime; a.state = item.state; a.Id = item.Id; RecordforA15.Am.Add(a); } RecordforA15.Hm = new List <A15dot1TabQiYe>(); List <A15dot1TabQiYe> His = Jx.GetHisJxItem(pv.Role_Names, pv.Department_Name, pv.Person_Name); foreach (var item in His) { A15dot1TabQiYe a = new A15dot1TabQiYe(); a.Id = item.Id; a.state = item.state; a.jdcOperateTime = item.jdcOperateTime; a.jdcOperator = item.jdcOperator; a.temp1 = Convert.ToString(His.IndexOf(item) + 1); RecordforA15.Hm.Add(a); } return(RecordforA15); }