private void BtnModifyUser_Click(object sender, EventArgs e) { try { string resmsg; if (lvUserList.SelectedItems.Count == 0l) { throw new Exception("请选择要修改的用户"); } string SelectUserDataAccount = lvUserList.FocusedItem.SubItems[0].Text; CommonData.UserMsgData data = userMsgList.Find( delegate(CommonData.UserMsgData outdata) { return(outdata.Account == SelectUserDataAccount); } ); //CommonData.UserMsgData userdata = new CommonData.UserMsgData //{ // Account = lvUserList.FocusedItem.SubItems[0].Text, // UserName = lvUserList.FocusedItem.SubItems[1].Text, // CreateDateTime = DateTime.Parse(lvUserList.FocusedItem.SubItems[2].Text), // FailureDateTime = DateTime.Parse(lvUserList.FocusedItem.SubItems[3].Text), // UpdateDateTime = DateTime.Parse(lvUserList.FocusedItem.SubItems[4].Text), // UserTel = lvUserList.FocusedItem.SubItems[5].Text, // UserPermission = int.Parse(lvUserList.FocusedItem.SubItems[6].Text), // IsOnline = bool.Parse(lvUserList.FocusedItem.SubItems[7].Text), // StateCode = bool.Parse(lvUserList.FocusedItem.SubItems[8].Text) //}; ManageUserForm manageUserForm = new ManageUserForm(2) { userdata = data }; DialogResult res = manageUserForm.ShowDialog(); if (res == DialogResult.OK) { data = manageUserForm.userdata; int ret = ReturnData.DoSetUserInfo(data, out resmsg); if (ret != 0) { throw new Exception(resmsg); } DisplayUserMsg(); MessageBox.Show("修改成功"); } //manageUserForm.ShowDialog(); } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }
private void GetConfigInfo() { string resmsg; Dictionary <Global.ConfigInfo, string> config = new Dictionary <Global.ConfigInfo, string>(); int ret = ReturnData.DoGetConfiginfo(out config, out resmsg); if (ret != 0) { throw new Exception(resmsg); } else { Global.ConfigInfoList.Clear(); Global.ConfigInfoList = config; } }
private void PayForm_Load(object sender, EventArgs e) { try { timer1.Interval = 1000; timerQuery.Interval = 5000; string outmsg = ""; payInfoList = new List <CommonData.PayPrarmsData>(); ReturnData.DoGetPayPrarms(out payInfoList, out outmsg); if (payInfoList.Count == 2) { for (int i = 0; i < payInfoList.Count; i++) { if (string.Compare(payInfoList[i].ConfigCode, "RenewalWay1") == 0) { rbRenewal1.Text = payInfoList[i].RenewalTime + "个月"; rbRenewal1.Checked = true; } if (string.Compare(payInfoList[i].ConfigCode, "RenewalWay2") == 0) { rbRenewal2.Text = payInfoList[i].RenewalTime + "个月"; } } } payData = new CommonData.PayData { Account = Global.userMsgData.Account, IsPreCreate = false, IsPay = false }; TimeTick = 120; timer1.Enabled = false; timerQuery.Enabled = false; lbTimeTick.Text = "0"; btnCreatQRCode.Enabled = true; btnCancelOrder.Enabled = false; lbAccount.Text = Global.userMsgData.Account; lbFailrueDateTime.Text = Global.userMsgData.FailureDateTime.ToLongDateString(); //FormClosing += PayForm_FormClosing; } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }
private void BtnYes_Click(object sender, EventArgs e) { try { string strFtpPath = tbFTPPath.Text; string strWebAddAddr = tbWebAddAddr.Text; string strYeMeiMsg = tbYeMei.Text; string strInitWebAddr = tbDefaultWebPath.Text; if (!string.IsNullOrEmpty(strFtpPath)) { Global.ConfigInfoList[Global.ConfigInfo.FtpPath] = strFtpPath; DialogResult = DialogResult.OK; } if (!string.IsNullOrEmpty(strWebAddAddr)) { Global.ConfigInfoList[Global.ConfigInfo.WebAddAddr] = strWebAddAddr; DialogResult = DialogResult.OK; } if (!string.IsNullOrEmpty(strYeMeiMsg)) { Global.ConfigInfoList[Global.ConfigInfo.YeMeiMsg] = strYeMeiMsg; DialogResult = DialogResult.OK; } if (!string.IsNullOrEmpty(strInitWebAddr)) { Global.ConfigInfoList[Global.ConfigInfo.InitAddr] = strInitWebAddr; DialogResult = DialogResult.OK; } else { throw new Exception("请正确输入"); } if (DialogResult == DialogResult.OK) { string resmsg; ReturnData.DoSetConfigInfo(Global.ConfigInfoList, out resmsg); } } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }
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); } }
/// <summary> /// 获取服务器上filelist /// </summary> public void GetServerFileList(string userAccount) { //fileListAccpect = new CommonData.FileData(); try { string resmsg; int res = ReturnData.DoUpdateFileList(userAccount, out resmsg, out fileListAccept); if (res != 0) { throw new Exception("更新文件出错"); } } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); throw; } }
public void DoLogout() { string retMsg; try { int res = ReturnData.DoLogout(Global.userMsgData.Account, out retMsg); FileSystem fs = new FileSystem(); fs.DelAllTempFile(Global.SysFilePath); if (res != 0) { throw new Exception(retMsg); } } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }
/// <summary> /// 取消订单 /// </summary> private void DoCancelOrder() { try { string retmsg; if (ReturnData.DoCancelPreOrder(payData.Account, payData.OrderNo, out retmsg) == 0) { payData.IsPreCreate = false; } else { throw new Exception(retmsg); } } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }
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); }
private int GetFilePermissionList() { int ret = -1; string retmsg; try { ret = ReturnData.DoGetFilePermissionList(out filePermissionList, out retmsg); 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); }
private void SetPayPrarmForm_Load(object sender, EventArgs e) { try { string retmsg = ""; payinfolist = new List <CommonData.PayPrarmsData>(); int ret = ReturnData.DoGetPayPrarms(out payinfolist, out retmsg); if (ret == 0) { tbPrice1.Text = payinfolist[0].Price; tbTime1.Text = payinfolist[0].RenewalTime; tbPrice2.Text = payinfolist[1].Price; tbTime2.Text = payinfolist[1].RenewalTime; } } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }
/// <summary> /// 查询订单 /// </summary> private void DoQueryOrder() { try { bool IsPay; string retmsg; if (ReturnData.DoQueryByOrder(payData.Account, payData.OrderNo, out retmsg, out IsPay) != 0) { throw new Exception("查询订单失败" + retmsg); } else { if (IsPay) { //支付完成 timerQuery.Enabled = false; timer1.Enabled = false; btnCreatQRCode.Enabled = true; btnCancelOrder.Enabled = false; TimeTick = 120; lbTimeTick.Text = "0"; picQRCode.Image = null; GetUserInfo(); lbFailrueDateTime.Text = Global.userMsgData.FailureDateTime.ToLongDateString(); MessageBox.Show("支付成功"); payData.IsPay = true; payData.PayDateTime = DateTime.Now; } else { //支付未完成 } } } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }
private void btnYes_Click(object sender, EventArgs e) { try { string retmsg = ""; if (string.IsNullOrEmpty(tbPrice1.Text) || string.IsNullOrEmpty(tbTime1.Text) || string.IsNullOrEmpty(tbPrice2.Text) || string.IsNullOrEmpty(tbTime2.Text)) { throw new Exception("支付参数输入错误"); } else { if (ReturnData.DoSetPayPrarms(tbPrice1.Text, tbTime1.Text, tbPrice2.Text, tbTime2.Text, out retmsg) == 0) { DialogResult = DialogResult.OK; } } } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }
private void BtnAddUser_Click(object sender, EventArgs e) { try { string resmsg; ManageUserForm manageUserForm = new ManageUserForm(1); DialogResult res = manageUserForm.ShowDialog(); if (res == DialogResult.OK) { userMsgList.Add(manageUserForm.userdata); if (ReturnData.DoCreateUserInfo(manageUserForm.userdata, out resmsg) != 0) { throw new Exception(resmsg); } DisplayUserMsg(); MessageBox.Show("添加成功"); } } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }
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; }