Пример #1
0
        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);
            }
        }
Пример #2
0
        private bool FreshData()
        {
            string empCode = teEmpCode.Text;

            string msg = EmpInfo.QueryEmpByCode(empCode);

            this.lueSystem.Properties.DisplayMember = "Name";
            this.lueSystem.Properties.ValueMember   = "Code";
            this.labelControl4.Text = msg;

            if (!msg.IsNullOrEmpty())
            {
                //MessageHelper.ShowError(msg);
                this.lueSystem.Properties.DataSource = null;
                return(false);
            }
            else
            {
                this.lueSystem.Properties.DataSource = EmpInfo.CanUseSystemList;
                //  获取上一次登录的系统
                this.lueSystem.EditValue = EmpInfo.GetLastSystemCode();
                return(true);
            }
        }