/// <summary> 加载记忆账户 /// </summary> private void LoadMemery() { this.dsUser = ConfigManager.User; if (this.dsUser == null) { this.dsUser = new DataSet(); } if (this.dsUser.Tables.Count == 0) { DataTable dt = new DataTable("User"); dt.Columns.Add("ID"); dt.Columns.Add("PWD"); this.dsUser.Tables.Add(dt); } this.dtUser = this.dsUser.Tables[0].Copy(); this.formCmbUserArray = new FormCmb(); this.formCmbUserArray.DisplayName = "ID"; this.formCmbUserArray.ValueName = "PWD"; this.formCmbUserArray.ItemHeight = 35; this.formCmbUserArray.BackColor = Color.White; this.formCmbUserArray.SelectedColor = Color.FromArgb(97, 167, 208); this.formCmbUserArray.ItemSelected += (display, valueFact) => { this.tbUser.Caption = display; this.tbPwd.Caption = valueFact; }; this.formCmbUserArray.BindCmb(this.tbUser.InnerTextBox, this.dtUser, this.tbUser.Location.X, this.panelUser.Height - this.tbUser.Location.Y - this.tbUser.Height, false); if (this.dtUser.Rows.Count > 0) { if (this.dtUser.Columns.Contains("ID")) { this.tbUser.Caption = this.dtUser.Rows[0]["ID"].ToString(); this.tbUser.Refresh(); } if (this.dtUser.Columns.Contains("PWD")) { this.tbPwd.Caption = this.dtUser.Rows[0]["PWD"].ToString(); this.tbPwd.Refresh(); } if (this.tbPwd.Caption.Trim().Length > 0) { pbChecked_Click(null, null); } //this.currentPage = 1; } }
private void ShowAccData(object obj) { this.uiHandler -= new UiHandler(this.ShowAccData); if (obj.ToString().Length > 0) { FormLoading.EndLoading(); if (this.formSet == null || !this.formSet.Visible) { FormMessgeBox.ShowMsg(this, "无法加载帐套数据!", this.panelTop.BackColor); } } this.enableFlag = true; //加载帐套 if (this.dtDb.Rows.Count > 0) { this.tbDb.Caption = this.dtDb.Rows[0]["DisplayName"].ToString(); this.tbDb.Tag = this.dtDb.Rows[0]["Value"].ToString(); if (this.tbUser.Caption.Trim().Length == 0) { this.tbUser.Focus(); } else { if (this.tbPwd.Caption.Trim().Length == 0) { this.tbPwd.Focus(); } else { this.panelLogin.Focus(); } } } this.formCmb = new FormCmb(); this.formCmb.DisplayName = "DisplayName"; this.formCmb.ValueName = "Value"; this.formCmb.ItemHeight = 35; this.formCmb.BackColor = Color.White; this.formCmb.SelectedColor = Color.FromArgb(97, 167, 208); this.formCmb.ItemSelected += new FormCmb.ItemSelectedHandler(this.SeletecdAccount); this.formCmb.BindCmb(this.tbDb.InnerTextBox, this.dtDb, this.tbDb.Location.X, this.panelDb.Height - this.tbDb.Location.Y - this.tbDb.Height, false); }
/// <summary> 加载记忆账户 /// </summary> private void LoadMemery() { this.dsUser = ConfigManager.User; if (this.dsUser == null) { this.dsUser = new DataSet(); } if (this.dsUser.Tables.Count == 0) { DataTable dt = new DataTable("User"); dt.Columns.Add("ID"); dt.Columns.Add("PWD"); this.dsUser.Tables.Add(dt); } this.dtUser = this.dsUser.Tables[0].Copy(); this.formCmbUserArray = new FormCmb(); this.formCmbUserArray.DisplayName = "ID"; this.formCmbUserArray.ValueName = "PWD"; this.formCmbUserArray.ItemHeight = 35; this.formCmbUserArray.BackColor = Color.White; this.formCmbUserArray.SelectedColor = Color.FromArgb(97, 167, 208); this.formCmbUserArray.ItemSelected += (display,valueFact) => { this.tbUser.Caption = display; this.tbPwd.Caption = valueFact; }; this.formCmbUserArray.BindCmb(this.tbUser.InnerTextBox, this.dtUser, this.tbUser.Location.X, this.panelUser.Height - this.tbUser.Location.Y - this.tbUser.Height, false); if (this.dtUser.Rows.Count > 0) { if (this.dtUser.Columns.Contains("ID")) { this.tbUser.Caption = this.dtUser.Rows[0]["ID"].ToString(); this.tbUser.Refresh(); } if (this.dtUser.Columns.Contains("PWD")) { this.tbPwd.Caption = this.dtUser.Rows[0]["PWD"].ToString(); this.tbPwd.Refresh(); } if (this.tbPwd.Caption.Trim().Length > 0) { pbChecked_Click(null, null); } //this.currentPage = 1; } }