public static string ResetPersonPass(string nmm, string ymm) { string r = ""; Sys_UserBll seb = new Sys_UserBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (seb.Exists(" and eno='" + iv.u.eno + "' and upass='******'")) { if (seb.RePersonSetPass(iv.u.eno, DES.EncryptDES(nmm)) > 0) { r = "S"; } else { r = "F"; } } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static string SaveEmploee(string account, string depcode, string depname, string duty, string eaddress, string eage, string eemail, string egradute, string eid, string elogin, string ename, string eno, string epwd, string esex, string esfz, string estate, string etelephone, string eworkdate, string role) { string r = ""; Sys_Employee se = new Sys_Employee(); Sys_User su = new Sys_User(); Sys_EmployeeDpt sed = new Sys_EmployeeDpt(); Sys_EmployeeBll seb = new Sys_EmployeeBll(); Sys_UserBll sub = new Sys_UserBll(); Sys_Employee cse = new Sys_Employee(); Sys_DepmentBll sdb = new Sys_DepmentBll(); Sys_EmployeeDptBll sedb = new Sys_EmployeeDptBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_Depment sd = sdb.Query(" and dcode='" + depcode.Substring(0, 8) + "'"); se.dname = depname; se.dcode = depcode; se.eno = eno; se.ename = ename; se.estate = estate == "1"?true:false; se.dtcode = ""; se.elogin = elogin == "1" ? true : false; se.ecdate = DateTime.Now.ToString(); se.emaker = iv.u.ename; se.rcode = role; sed.eaddress = eaddress; sed.eage = Convert.ToInt32(eage); sed.eeducation = egradute; sed.eemail = eemail; sed.eheadimage = ""; sed.eidentity = esfz; sed.enativeplace = ""; sed.eno = eno; sed.esex = esex == "1" ? true : false; sed.etelephone = etelephone; sed.eworkdate = eworkdate; su.eno = eno; su.upass = DES.EncryptDES(epwd); if (sd.dabc != "") { su.uname = sd.dabc + "_" + account; } else { su.uname = account; } su.ulogin = elogin == "1"?true:false; su.uip = ""; su.ulogintime = ""; if (eid == "0") { if (!seb.Exists(" and eno='" + eno + "'")) { if (!sub.Exists(" and uname='" + su.uname + "'")) { if (seb.AddList(se, sed, su) > 0) { r = "S"; } else { r = "F"; } } else { r = "TA"; } } else { r = "T"; } } else { if (!seb.Exists(" and eno='" + eno + "' and id<>" + eid + "")) { if (!sub.Exists(" and uname='" + su.uname + "' and eno<>'" + eno + "'")) { cse = seb.Query(" and id=" + eid + ""); if (cse != null) { if (seb.UpdateList(cse.eno, se, sed, su) > 0) { r = "S"; } else { r = "F"; } } else { r = "F"; } } else { r = "TA"; } } else { r = "T"; } } } else { r = iv.badstr; } return(r); }