/// <summary> /// 构造函数 /// </summary> /// <param name="connstr">连接字符串</param> /// <param name="service">web服务</param> /// <param name="frmP">主窗体对象</param> public FrmSupplement(string connstr,DXTU8Service.ServiceSoap service,frmPrint frmP) { InitializeComponent(); this.service = service; this.connstr = connstr; this.frmP = frmP; XmlNode xn; int rt = service.GetClassTree(out xn,connstr); //U8Common.GetClassTree(out xn); if (rt == 0) { tvClass.Nodes.Clear(); foreach (XmlNode sub1Xml in xn.SelectNodes("First")) { TreeNode tn1 = new TreeNode(); tn1.Name = sub1Xml.Attributes["cInvCCode"].Value; tn1.Text = sub1Xml.Attributes["cInvCName"].Value + "(" + tn1.Name + ")"; foreach (XmlNode sub2Xml in sub1Xml.SelectNodes("Second")) { TreeNode tn2 = new TreeNode(); tn2.Name = sub2Xml.Attributes["cInvCCode"].Value; tn2.Text = sub2Xml.Attributes["cInvCName"].Value + "(" + tn2.Name + ")"; //foreach (XmlNode sub3Xml in sub2Xml.SelectNodes("Third")) //{ // TreeNode tn3 = new TreeNode(); // tn3.Name = sub3Xml.Attributes["cInvCCode"].Value; // tn3.Text = sub3Xml.Attributes["cInvCName"].Value + "(" + tn3.Name + ")"; // tn2.Nodes.Add(tn3); //} tn1.Nodes.Add(tn2); } tvClass.Nodes.Add(tn1); } //TreeNode root = new TreeNode("root"); //Recursive(root, xn, 0); //tvClass.Nodes.Add(root); } else { tvClass.Nodes.Clear(); } }
private void frmLogin_Load(object sender, EventArgs e) { server = ConfigurationManager.AppSettings["Servier"].ToString(); dbname = ConfigurationManager.AppSettings["dbname"].ToString(); user = ConfigurationManager.AppSettings["user"].ToString(); pwd = ConfigurationManager.AppSettings["pwd"].ToString(); service = new ServiceSoapClient(); int year = DateTime.Now.Year; //加载年度下拉框数据 for (int i = 0; i < 10; i++) { cBoxYear.Items.Add(year - i); } cBoxYear.SelectedIndex = 0; }