Esempio n. 1
0
        public static bool ShowPermission2(string msg, EnumRightType loginType, string userName = null)
        {
            frmPermission2 frm = new frmPermission2(userName);

            frm.label10.Text = msg;
            frm._loginType   = loginType;
            frm.ShowDialog();
            return(frm.DialogResult == DialogResult.OK);
        }
Esempio n. 2
0
        public Tuple <string, string> Login(string userName, string password, EnumRightType rightType)
        {
            string addr      = "http://" + RestClient.server + "/" + RestClient.apiPath + "/padinterface/login.json";
            var    encodePwd = CEncoder.GenerateMD5Hash(password);
            var    request   = new AuthorizeLoginRequest(userName, encodePwd, GetRightCode(rightType));

            try
            {
                var result = HttpHelper.HttpPost <AuthorizeLoginResponse>(addr, request);
                return(result.IsSuccess ? new Tuple <string, string>(null, result.fullname) : new Tuple <string, string>(result.msg, null));
            }
            catch (Exception ex)
            {
                //AllLog.Instance.E(ex);
                return(new Tuple <string, string>(ex.Message, null));
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 获取授权码。
 /// </summary>
 /// <param name="rightType"></param>
 /// <returns></returns>
 private string GetRightCode(EnumRightType rightType)
 {
     return(string.Format("03020{0}", (int)rightType));
 }