/// <summary> /// 账户设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnMessage_Press(object sender, EventArgs e) { try { if (UserID == "13123456789") { throw new Exception("测试用户没有此权限"); } frmSet frm = new frmSet(); frm.eInfo = eInfo; frm.isDemo = isDemo; this.Form.Show(frm); } catch (Exception ex) { Toast(ex.Message); } }
private void btnSet_Click(object sender, System.EventArgs e) { //Pengw string strSql=""; if(lblName.Text=="վ�㣺") { strSql=string.Format("select watAddress from tbWell where wellName='{0}'",txtZhan.Text); } else { MessageBox.Show("��ѡ������վ��"); return; } DataTable dtWell=null; BengZhan.CDBConnection.getDataTable(ref dtWell,strSql,"tbSetWell"); string strAddress=dtWell.Rows[0]["watAddress"].ToString(); // strCmd=strCmd.Replace("xx",int.Parse(strAddress).ToString("x")); // if(this.Cursor==Cursors.WaitCursor) { return ; } if(this.cmbInfo.Text.IndexOf("����")>=0) { this.clearAmount(strAddress); return; } if(this.cmbInfo.Text.Trim()=="") { MessageBox.Show("��ѡ���������!"); return; } frmSet frmS=new frmSet(); if(this.cmbInfo.Text.IndexOf("����")>=0) { frmS.m_strInfo=this.cmbInfo.Text.Trim(); frmS.m_strDan =LoadDan(frmS.m_strInfo); frmS.ShowDialog(); } if(frmS.m_strVal=="exit") { return; } if(frmS.m_strVal=="") { frmS.m_strVal="1"; } if(frmS.m_strVal!="") { XmlDocument xDoc=new XmlDocument();; xDoc.Load("farCmd.xml"); string strXPath=string.Format("./farCmd/setAmount[@des='{0}']",this.cmbInfo.Text.Trim()); XmlNode xNode=xDoc.DocumentElement.SelectSingleNode(strXPath); if(xNode==null) { MessageBox.Show("��ѡ���������!"); return; } string strCmd=xNode.Attributes.GetNamedItem("val").Value.Trim(); //wangp strCmd=strCmd.Replace("xx",int.Parse(strAddress).ToString("x")); // string strSleep=xNode.Attributes.GetNamedItem("sleep").Value.Trim(); bool bHaveCheck=false; if(xNode.Attributes.GetNamedItem("bHaveCheck")!=null) { if(xNode.Attributes.GetNamedItem("bHaveCheck").Value.Trim()=="1") { bHaveCheck=true; } } this.m_arrBackInfo.Clear(); if(bHaveCheck) { this.m_frmCom.farCmd(strCmd); } else { if(this.cmbInfo.Text.IndexOf("����")>=0) { this.setCardNo(strCmd,frmS.m_strVal); } else { this.farSetCmd(strCmd,frmS.m_strVal); } } this.sleep(int.Parse(strSleep)); if(this.m_arrBackInfo.Count>0) { MessageBox.Show(this.m_arrBackInfo[0].ToString()); } else { MessageBox.Show("�ȴ���ʱ��"); } } }