public override bool Login() { string passwd = this.tePassword.Text; string system_code = this.lueSystem.EditValue.ToString(); string ret = ""; if (string.IsNullOrEmpty(passwd)) { ret = "请输入密码"; } else { ret = EmpInfo.Login(EnvInfo.BranchId, system_code, passwd); } if (ret.IsNullOrEmpty()) { var parmList = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("empId", EmpInfo.Id.ToString()) }; CustomException ce = null; BDictEmp empInfo = HttpDataHelper.GetWithInfo <BDictEmp>("BASE", "/sys/empinfo", out ce, parmList); List <string> roleList = HttpDataHelper.GetWithInfo <List <string> >("BASE", "/sys/role", out ce, parmList); List <CDictAction> actionList = HttpDataHelper.GetWithInfo <List <CDictAction> >("BASE", "/sys/action", out ce, parmList); EmpInfo.SetEmpInfo(empInfo, roleList, actionList); return(true); } else { MessageHelper.ShowError(ret); return(false); } }
public static void SetEmpInfo(BDictEmp emp, List <string> roleList, List <CDictAction> actionList) { EmpInfo.Name = emp.Name; EmpInfo.Ceid = emp.Ceid; EmpInfo.DeptId = emp.DeptId; EmpInfo.DeptName = emp.DeptName; EmpInfo.BizDeptId = emp.BizDeptId; EmpInfo.BizDeptName = emp.BizDeptName; EmpInfo.GroupId = emp.GroupId; EmpInfo.GroupName = emp.GroupName; EmpInfo.TitlesId = emp.TitlesId; EmpInfo.TitlesName = emp.TitlesName; EmpInfo.RoleList = roleList; EmpInfo.ActionRoleList = actionList; var parmList = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("empId", EmpInfo.Id.ToString()), new KeyValuePair <string, string>("parmName", "DEF_INPUT") }; CustomException ce = null; String defInput = HttpDataHelper.GetStringWithInfo("BASE", "/sys/parameteremp", out ce, parmList); if (ce != null) { MessageHelper.ShowError("获取默认输入法失败!\r\n" + ce.Info + " " + ce.InnerMessage); } if (String.IsNullOrEmpty(defInput)) { EmpInfo.InputChoice = "1"; } else { EmpInfo.InputChoice = defInput; } }