Exemplo n.º 1
0
        private void GetUserInfo()
        {
            List <CommonData.UserMsgData> userlist = new List <CommonData.UserMsgData>();
            string retmsg;

            if (ReturnData.DoGetInfoByAccount(payData.Account, out retmsg, out userlist) == 0)
            {
                //Log.Debug("failure date time before : " + Global.userMsgData.FailureDateTime.ToLongDateString());
                if (userlist.Count > 0)
                {
                    Global.userMsgData = userlist[0];
                }
                //Log.Debug("failure date time after : " + Global.userMsgData.FailureDateTime.ToLongDateString());
            }
            else
            {
                throw new Exception("重新获取用户信息失败,请检查网络设置" + retmsg);
            }
        }
Exemplo n.º 2
0
        private int GetAlUser()
        {
            int    ret = -1;
            string retmsg;

            try
            {
                ret = ReturnData.DoGetInfoByAccount("", out retmsg, out userMsgList);
                if (ret != 0)
                {
                    MessageBox.Show(retmsg);
                }
            }
            catch (Exception ex)
            {
                Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex);
                MessageBox.Show(ex.Message);
            }
            return(ret);
        }
Exemplo n.º 3
0
 private void DoLogin()
 {
     //Thread.Sleep(5000);
     Setprams();
     //initSetConfig();
     try
     {
         Control.CheckForIllegalCrossThreadCalls = false;
         int res = ReturnData.DoCheckPsw(StrAccount, StrPsd, out RetMsg, out RetCode);
         if (res == 0)
         {
             Global.LoginUserID         = StrAccount;
             Global.userMsgData.Account = StrAccount;
             if (checkBox2.Checked)
             {
                 Global.LoginUserPsw = StrPsd;
             }
             else
             {
                 Global.LoginUserPsw = "";
             }
             if (Global.userMsgData.UserPermission == 1)
             {
                 while (!IsHandleCreated)
                 {
                     ;
                 }
                 MethodInvoker MethInvo = new MethodInvoker(ShowMainForm);
                 BeginInvoke(MethInvo);
             }
             else if (Global.userMsgData.UserPermission == 2)
             {
                 while (!IsHandleCreated)
                 {
                     ;
                 }
                 MethodInvoker MethInvo = new MethodInvoker(ShowManageForm);
                 BeginInvoke(MethInvo);
             }
             List <CommonData.UserMsgData> userlist = new List <CommonData.UserMsgData>();
             res = ReturnData.DoGetInfoByAccount(StrAccount, out RetMsg, out userlist);
             if (res == 0)
             {
                 Global.userMsgData = userlist[0];
             }
         }
         else
         {
             if (RetCode == 99)
             {
                 //续期
                 List <CommonData.UserMsgData> userlist = new List <CommonData.UserMsgData>();
                 res = ReturnData.DoGetInfoByAccount(StrAccount, out RetMsg, out userlist);
                 if (res == 0)
                 {
                     Global.userMsgData = userlist[0];
                 }
                 PayForm payForm = new PayForm();
                 payForm.ShowDialog();
             }
             else
             {
                 MessageBox.Show(RetMsg);
             }
         }
         IsBeingLogin(false);
     }
     catch (Exception ex)
     {
         Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex);
         MessageBox.Show(ex.Message);
     }
     return;
 }