public Result Txn110101(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = new Result(); Result ret = new Result(); int userno = 0; userno = Static.ToInt(ri.ReceivedParam[0]); try { ret.ResultNo = 9110002; res = DBIO.DB203002(db, userno); // Хэрэглэгчийн дэлгэрэнгүй мэдээлэл if (res.ResultNo != 0) { return(res); } res.Data.Tables[0].TableName = "Users"; DataSet ds = new DataSet(); ds.Tables.Add(res.Data.Tables[0].Copy()); res = DBIO.DB203003(db, userno); // Хэрэглэгчийн сонгогдсон болон сонгогдоогүй эрхүүд if (res.ResultNo != 0) { return(res); } res.Data.Tables[0].TableName = "UserPriv"; ds.Tables.Add(res.Data.Tables[0].Copy()); res = DBIO.DB203004(db, userno); // Хэрэглэгчийн supervisor хэрэглэгч нар if (res.ResultNo != 0) { return(res); } res.Data.Tables[0].TableName = "UserSup"; ds.Tables.Add(res.Data.Tables[0].Copy()); ret.Data = ds; ret.ResultNo = 0; return(ret); } catch (Exception ex) { res.ResultNo = 9110002; res.ResultDesc = "Програм руу нэвтрэхэд алдаа гарлаа" + ex.Message; EServ.Shared.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); return(res); } finally { lg.item.Desc = "Хэрэглэгчийн мэдээлэл авах"; object[] newvalue = new object[2]; newvalue[0] = userno; newvalue[1] = res.ResultNo; lg.AddDetail("HPUSER", newvalue[0].ToString(), "Хэрэглэгчийн мэдээлэл авах", newvalue[1].ToString()); } }
public Result Txn110104(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = new Result(); object[] value = (object[])ri.ReceivedParam[0]; object[] obj = new object[19]; int userno = Static.ToInt(ri.ReceivedParam[5]); long olpassword = Static.ToLong(ri.ReceivedParam[3]); long password = Static.ToLong(ri.ReceivedParam[4]); Result PassPolicy = new Result(); PassPolicy = DBIO.DB216001(db); DataRow _dr; _dr = PassPolicy.Data.Tables[0].Rows[0]; Result pres = new Result(); pres = DBIO.DB203002(db, userno); DataRow _drow; _drow = pres.Data.Tables[0].Rows[0]; decimal pass = Static.ToDecimal(_drow["UPASSWORD"]); if (Static.ToLong(olpassword) != Static.ToLong(password)) { if (Static.ToStr(_dr["ISSENDMAIL"]) == Static.ToStr(1)) { if (PassPolicy.ResultNo == 0) { _dr = PassPolicy.Data.Tables[0].Rows[0]; MailMessage msg = new MailMessage(); msg.From = new MailAddress(Static.ToStr(_dr["FROMUSER"])); msg.To.Add(new MailAddress(Static.ToStr(obj[12]).ToLower())); msg.Subject = obj[2] + " Таны нэвтрэх нэр, нууц үг"; object[] uspassword = (object[])ri.ReceivedParam[4]; for (int i = 0; i < uspassword.Length; i++) { msg.Body = "Таны нэвтрэх нэр, нууц үг\r\n\r\n\tХэрэглэгчийн дугаар: " + obj[0] + "\r\n\tНууц үг: " + uspassword[i]; } SmtpClient smtp = new SmtpClient(Static.ToStr(_dr["SERVERNAME"])); smtp.Credentials = new System.Net.NetworkCredential((Static.ToStr(_dr["MAILUSERNAME"])), (Static.ToStr(_dr["MAILUSERPASS"]))); smtp.Port = Static.ToInt(_dr["SERVERPORT"]); smtp.Send(msg); } } } try { obj[0] = value[0]; // UserNo obj[1] = value[1]; //UserFname obj[2] = value[2]; //UserLname obj[3] = value[3]; //UserFname2 obj[4] = value[4]; //UserLname2 obj[5] = value[5]; //RegisterNo obj[6] = value[6]; //Position obj[7] = value[7]; //Status obj[8] = value[8]; //BranchNo obj[9] = value[9]; //UserLevel obj[10] = value[10]; //UPassword obj[11] = value[11]; //UserType obj[12] = value[12]; //Email obj[13] = value[13]; //Mobile obj[14] = value[14]; //Logintype obj[15] = value[15]; // WrongCount obj[16] = value[16]; //PassChangeDate obj[17] = value[17]; // AgentCorp obj[18] = value[18]; //AgentBranch if (value[19] != null) { DataTable priv = (DataTable)value[19]; res = DBIO.DB203009(db, Static.ToInt(value[0]), priv); if (res.ResultNo != 0) { return(res); } } if (value[20] != null) { DataTable sup = (DataTable)value[20]; res = DBIO.DB203010(db, Static.ToInt(value[0]), sup); if (res.ResultNo != 0) { return(res); } } res = DBIO.DB203007(db, obj); EServ.Shared.Static.WriteToLogFile("Error.log", "DB203007" + res.ResultNo.ToString() + res.ResultDesc); return(res); } catch (Exception ex) { res.ResultNo = 9110002; res.ResultDesc = "Програм руу нэвтрэхэд алдаа гарлаа" + ex.Message; EServ.Shared.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); return(res); } finally { lg.item.Desc = "Хэрэглэгчийн мэдээлэл засварлах"; object[] fieldValue = (object[])ri.ReceivedParam[1]; object[] newValue = (object[])ri.ReceivedParam[0]; object[] oldValue = (object[])ri.ReceivedParam[2]; for (int i = 0; i < fieldValue.Length; i++) { if (oldValue[i] != newValue[i]) { lg.AddDetail("HPUSER", Static.ToStr(fieldValue[i]), Static.ToStr(oldValue[i]), Static.ToStr(newValue[i])); } } } }