Пример #1
0
 private void btnPay_Click(object sender, EventArgs e)
 {
     try
     {
         PayForm payform = new PayForm();
         payform.ShowDialog();
     }
     catch (Exception ex)
     {
         Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex);
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
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;
 }