public int UnlockManagerUser(ManageUser m) { try { return _manageUserDao.UnlockManagerUser(m); } catch (Exception ex) { throw new Exception("ManageUserMgr-->UnlockManagerUser-->" + ex.Message, ex); } }
public List<ManageUser> GetManageUser(ManageUser m) { try { return _manageUserDao.GetManageUser(m); } catch (Exception ex) { throw new Exception("ManageUserMgr-->GetProductName-->" + ex.Message, ex); } }
/// <summary> /// 根據userid獲取用戶信息 /// </summary> /// <param name="p"></param> /// <returns></returns> public List<ManageUser> GetManageUser(ManageUser m) { StringBuilder sb = new StringBuilder(); try { sb.AppendFormat("SELECT * from manage_user WHERE user_id='{0}'; ", m.user_id); return _access.getDataTableForObj<ManageUser>(sb.ToString()); } catch (Exception ex) { throw new Exception("ProductDao-->GetManageUser" + ex.Message + sb.ToString(), ex); } }
public int UnlockManagerUser(ManageUser m) { StringBuilder sb = new StringBuilder(); try { sb.AppendFormat("update manage_user set user_login_attempts='{0}' ", m.user_login_attempts); sb.AppendFormat(" , user_status='{0}' ", m.user_status); sb.AppendFormat(" where user_id ='{0}' ;", m.user_id); return _access.execCommand(sb.ToString()); } catch (Exception ex) { throw new Exception("ManageUserDao-->UnlockManagerUser" + ex.Message + sb.ToString(), ex); } }
public HttpResponseBase GetManagerUser() { string json = string.Empty; ManageUser mu = new ManageUser(); ManageUserQuery muq = new ManageUserQuery(); int totalCount = 0; List<ManageUser> store = new List<ManageUser>(); List<ManageUserQuery> storeq = new List<ManageUserQuery>(); try { _muMgr = new ManageUserMgr(mySqlConnectionString); //判斷輸入密碼是否和登入密碼一樣 if (!string.IsNullOrEmpty(Request.Params["user_id"])) { mu.user_id = uint.Parse(Request.Params["user_id"]); store = _muMgr.GetManageUser(mu); if (store.Count > 0) { if (!string.IsNullOrEmpty(Request.Params["secret_password"])) { HashEncrypt hmd5 = new HashEncrypt(); if (hmd5.SHA256Encrypt(Request.Params["secret_password"]) == store[0].user_password) { json = "{success:false}"; } else { json = "{success:true}"; } } } else { json = "{success:false}"; } } //獲取管理用戶下拉列表 else { muq.IsPage = false; muq.user_username = Request.Params["user_name"]; muq.user_status = 1; storeq = _muMgr.GetNameMail(muq, out totalCount); json = "{success:true,data:" + JsonConvert.SerializeObject(storeq, Formatting.Indented) + "}";//返回json數據 } } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }