public IGrid FindRecord(Model.Table.User u, IParameter <Model.Table.Record> param) { IGrid g = param.GetGrid(); UP_Simple up = new UP_Simple("UP_SelectRecord"); up.InputParams.Add("begin", param.begin + 1); up.InputParams.Add("end", param.begin + param.count); up.InputParams.Add("ext", param.GetNullString("reclis_ext")); up.InputParams.Add("caller", param.GetNullString("reclis_calling")); up.InputParams.Add("called", param.GetNullString("reclis_called")); up.InputParams.Add("max", param.GetInt("reclis_starttime")); up.InputParams.Add("min", param.GetInt("reclis_starttime")); switch (param.GetInt("reclis_calltype")) { case 1: up.InputParams.Add("type", 0); break; case 2: up.InputParams.Add("type", 3); break; } up.InputParams.Add("beginDate", param.GetNullString("reclis_starttime")); up.InputParams.Add("endDate", param.GetNullString("reclis_endtime")); up.InputParams.Add("agentid", param.GetNullString("reclis_agentid")); // up.InputParams.Add("serverfalg", param.begin + 1); //up.InputParams.Add("checked", param.GetInt("checkState")); g.SwitchData = new RecordSwitchData(this); g.SwitchData.@checked = param.GetBool("checkState") ?? false; g.ExecProc(up); return(g); }
public IMenu GetMenu(Model.Table.User u) { Esunnet.Model.Frame.IMenu m = new Esunnet.Model.Frame.Dhtmlx.Menu.Menu(); UP_GetMenu us = new UP_GetMenu(u.id, u.permission); using (DbClinet db = new DbClinet()) { List <Dictionary <string, object> > mv = db.Select(us); for (int i = 0; i < mv.Count; i++) { Node n = new Node(); n.id = mv[i]["id"]; n.pid = mv[i]["pid"]; n.text = mv[i]["text"] as string; n.title = mv[i]["title"] as string; n.type = "node"; Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add(C.FUN, mv[i]["function"] as string); dic.Add(C.PATH, mv[i]["path"] as string); dic.Add(C.PARAM, mv[i]["remark"] as string); n.userdata = dic; m.Add(n); } } return(m); }
public User Login(Model.Table.User u) { String pw = u.userPassword; u.userId = "admin"; // u.userPassword = "******"; using (DbClinet db = new DbClinet()) { db.AddParameter("@userId", u.userId); List <Dictionary <string, object> > mv = db.Select("select * from SYS_User where userId=@userId"); if (mv.Count > 0) { string userPasswordTemp = mv.FirstOrDefault()["userPassword"] as string; if (userPasswordTemp.Equals(u.userPassword, StringComparison.OrdinalIgnoreCase)) { //u.lastLoginIp = mv.FirstOrDefault()["lastLoginIp"] as string; u.State = 1; db.AddParameter("@userId", u.userId); db.AddParameter("@ip", u.lastLoginIp); db.ExecuteNonQuery("update SYS_User set lastLoginTime=GETDATE(),lastLoginIp=@ip where userId=@userId"); } else { //密码错误 u.State = -1; } } else { u.State = -2; //不存在用户 } } return(u); }
public bool UpdatePassword(Model.Table.User u) { using (DbClinet db = new DbClinet()) { db.AddParameter("@userPassword", u.userPassword); db.AddParameter("@userId", u.userId); db.ExecuteNonQuery("update SYS_User set userPassword=@userPassword where userId=@userId"); return(true); } }
public bool SetPermission(Model.Table.User u, List <Model.Tool.Permission.PermLeaf> pl) { throw new NotImplementedException(); }
public bool ResetUserPassword(Model.Table.User u) { throw new NotImplementedException(); }
public bool DeleteUser(Model.Table.User u) { throw new NotImplementedException(); }