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"); } } }
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"); } } } }
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); }
public Index_ModelforA15 getRecord_detail(string id) { Index_ModelforA15 RecordforA15 = new Index_ModelforA15(); RecordforA15.Am = new List<A15dot1Tab>(); RecordforA15.Hm = new List<A15dot1Tab>(); ViewBag.curtime = DateTime.Now.ToString(); ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name; int IntId = Convert.ToInt32(id); List<A15dot1Tab> miss = Jx.GetJxItem_detail(IntId); 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; //增加变量--参与统计台数 a.Count_timesNonPlanStop = item.Count_timesNonPlanStop; a.Count_scoreDeductFaultIntensity = item.Count_scoreDeductFaultIntensity; a.Count_rateBigUnitFault = item.Count_rateBigUnitFault; a.Count_rateFaultMaintenance = item.Count_rateFaultMaintenance; a.Count_MTBF = item.Count_MTBF; a.Count_rateEquipUse = item.Count_rateEquipUse; a.Count_avgLifeSpanSeal = item.Count_avgLifeSpanSeal; a.Count_avgLifeSpanAxle = item.Count_avgLifeSpanAxle; a.Count_percentEquipAvailability = item.Count_percentEquipAvailability; a.Count_percentPassOnetimeRepair = item.Count_percentPassOnetimeRepair; 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<A15dot1Tab> His = Jx.GetHisJxItem_detail(IntId); foreach (var item in His) { 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; //增加变量--参与统计台数 a.Count_timesNonPlanStop = item.Count_timesNonPlanStop; a.Count_scoreDeductFaultIntensity = item.Count_scoreDeductFaultIntensity; a.Count_rateBigUnitFault = item.Count_rateBigUnitFault; a.Count_rateFaultMaintenance = item.Count_rateFaultMaintenance; a.Count_MTBF = item.Count_MTBF; a.Count_rateEquipUse = item.Count_rateEquipUse; a.Count_avgLifeSpanSeal = item.Count_avgLifeSpanSeal; a.Count_avgLifeSpanAxle = item.Count_avgLifeSpanAxle; a.Count_percentEquipAvailability = item.Count_percentEquipAvailability; a.Count_percentPassOnetimeRepair = item.Count_percentPassOnetimeRepair; 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; }