private void button1_Click(object sender, EventArgs e) { if (bsOrd.Position < bsOrd.Count - 1) { bsOrd.MoveNext(); } }
private void CliquerSurSuivantTransaction(object sender, EventArgs e) { bs.MoveNext(); lblType.Text = typeTranscation[(int)ds.Tables["_Transaction"].Rows[bs.Position][6]]; lblMontant.Text += " €"; lblEnregistrement.Text = "Enregistrement " + (bs.Position + 1) + " / " + bs.Count; }
private void cNext_Click(object sender, EventArgs e) { if (bsCust.Position < bsCust.Count - 1) { bsCust.MoveNext(); } }
private void WaveFileChanger_post_Load(object sender, EventArgs e) { cn = new SQLiteConnection(@"Data Source=" + Var.pp + @"\post.db;Version=3;"); cmd.Connection = cn; cn.Open(); cmd.CommandText = "begin"; cmd.ExecuteNonQuery(); da.SelectCommand = new SQLiteCommand("Select * From " + table, cn); ds.Clear(); da.Fill(ds); bs.DataSource = ds.Tables[0]; txt_deltaT.DataBindings.Add(new Binding("Text", bs, "txt_deltaT")); txt_file_name.DataBindings.Add(new Binding("Text", bs, "txt_file_name")); txt_lines_to_skip.DataBindings.Add(new Binding("Value", bs, "txt_lines_to_skip")); txt_points_per_line.DataBindings.Add(new Binding("Value", bs, "txt_points_per_line")); txt_prefix.DataBindings.Add(new Binding("Value", bs, "txt_prefix")); txt_text.DataBindings.Add(new Binding("Text", bs, "txt_text")); rdb_values.DataBindings.Add(new Binding("Checked", bs, "rdb_values")); cmd.CommandText = "end"; cmd.ExecuteNonQuery(); cn.Close(); //Edit_XX: There is a problem here (infinite loop) --Fixed while (bs.Position < bs.Count) { if (txt_file_name.Text.Trim().Equals(wave.File_Name)) { break; } bs.MoveNext(); } validateNZ2(); }
private void btSau_Click(object sender, EventArgs e) { try { source.MoveNext(); ShowRecord(); XemDiemTheoKySinhVien(); } catch { } }
private void CommentEntry_MouseWheel(object sender, MouseEventArgs e) { if (e.Delta == -120) { bs.MoveNext(); } else if (e.Delta == 120) { bs.MovePrevious(); } }
protected void SurveyEntry_OnMouseWheel(object sender, MouseEventArgs e) { if (e.Delta == -120) { bs.MoveNext(); } else if (e.Delta == 120) { bs.MovePrevious(); } }
private void CliquerSurSuivantTransaction(object sender, EventArgs e) { bs.MoveNext(); lblType.Text = typeTransaction[(int)ds.Tables["_Transaction"].Rows[bs.Position][6]]; lblMontant.Text += " €"; lblEnregistrement.Text = "Enregistrement " + (bs.Position + 1) + " / " + bs.Count; if (ds.Tables["_Beneficiaires"] != null) { ds.Tables["_Beneficiaires"].Clear(); } new OleDbDataAdapter(new CMD(@"SELECT p.codePersonne, p.nomPersonne, p.pnPersonne FROM Personne p, Beneficiaires b WHERE b.codePersonne = p.codePersonne AND b.codeTransaction = " + lblId.Text, con)).Fill(ds, "_Beneficiaires"); dataGridView1.DataSource = ds.Tables["_Beneficiaires"]; }
private void button_23_Click_1(object sender, EventArgs e) { bs.MoveNext(); label6.Text = "Hysteretic Rule Number: " + (bs.Position + 1) + " of " + total.ToString(); if (button_23.Text == "Finish") { this.bs.EndEdit(); SQLiteCommandBuilder mySQLiteCommandBuilder = new SQLiteCommandBuilder(da); this.da.Update(ds.Tables[0]); this.Close(); } if (bs.Position + 1 == total) { button_23.Text = "Finish"; } checkBox1.Checked = false; checkBox10.Checked = false; checkBox12.Checked = false; checkBox2.Checked = false; checkBox3.Checked = false; checkBox4.Checked = false; checkBox6.Checked = false; checkBox7.Checked = false; }
public void Update() { BindingSource bs = new BindingSource(); bs.MoveNext(); data.Save(); }
private void metroButton3_Click(object sender, EventArgs e) { bs.DataSource = ds.Tables[0]; // BindingSource bs = new BindingSource(); bs.MoveNext(); dpupg(); }
/* * afficherRes : void : met à jour les données affichées lorsque l'on clique sur un bouton * Entrée : * sender : object : bouton sur lequel l'utilisateur a appuyé * e : EventArgs : évènement (ex : click sur le bouton) * Sortie : * void */ private void afficherRes(object sender, EventArgs e) { //on récupère le bouton sur lequel l'utilisateur a appuyé Button b = (Button)sender; //selon le bouton on avance, recule, ou bien affichons la première/dernière transaction if (b == btnPremier) { transactionsBS.MoveFirst(); } else if (b == btnPrecedent) { transactionsBS.MovePrevious(); } else if (b == btnSuivant) { transactionsBS.MoveNext(); } else if (b == btnDernier) { transactionsBS.MoveLast(); } //on met à jour le numéro de transaction, ainsi que les personnes concernées lblPage.Text = string.Format(Program.settings.localize.Translate("page_{0}_of_{1}"), transactionsBS.Position + 1, transactionsBS.Count); updatePersonnes(); }
void tsbtnMoveNextItem_Click(object sender, EventArgs e) { if (BindingSource != null) { BindingSource.MoveNext(); } }
private void fiNext_Click(object sender, EventArgs e) { if (bsItems.Position < bsItems.Count - 1) { bsItems.MoveNext(); } }
private void toolStripButton1_Click(object sender, EventArgs e) { // If you are not at the end of the list, move to the next item // in the BindingSource. while (true) { if (_customerBindingSource.Position + 1 < _customerBindingSource.Count) { DataRowView curr = (DataRowView)_customerBindingSource.Current; string str = curr[3].ToString(); if (str.IndexOf("'", 0, StringComparison.Ordinal) >= 0) { str = str.Remove(0, 1); // str = str.Remove(str.Length - 1); curr[3] = str; } _customerBindingSource.MoveNext(); } // Otherwise, move back to the first item. else { _customerBindingSource.MoveFirst(); break; } } // Force the form to repaint. this.Invalidate(); }
private void AutoRun() { while (bs.Position < bs.Count && bs.Position > -1) { if (double.Parse(db.drMaster["Conlai"].ToString()) > 100000 && (checkBox1.Checked)) { simpleButton2_Click(simpleButton2, new EventArgs()); simpleButton1_Click(simpleButton1, new EventArgs()); } else { if (!checkBox1.Checked) { break; } if (double.Parse(db.drMaster["Conlai"].ToString()) <= 100000) { bs.MoveNext(); } if (bs.Position == bs.Count - 1) { break; } } if (Control.MouseButtons == MouseButtons.Right)//it should stop now { break; } } }
private void NextChild_Click(object sender, EventArgs e) { if (saveprompt) { DialogResult x = MessageBox.Show("Do you want to save the data first?", "Important", MessageBoxButtons.YesNo); if (x == DialogResult.Yes) { try { orders_bndSource.EndEdit(); order_details_bndSource.EndEdit(); orders_dAdapter.Update(NW_Orders, "Orders"); order_details_dAdapter.Update(NW_Orders, "Order Details"); MessageBox.Show("Record Updated"); } catch (OleDbException f) { MessageBox.Show("Record Update Failed - Error Code " + f.ErrorCode.ToString()); } } } order_details_bndSource.MoveNext(); this.textBox2.Text = "" + (order_details_bndSource.Position + 1); saveprompt = false; }
public void initializationInvestProject() { BindingSource bindingSource = new BindingSource(); InvestProjectDAO dao = new InvestProjectDAO(); bindingSource.Clear(); bindingSource.DataSource = dao.getAll(); dataGridInvestProject.DataSource = bindingSource; bindingSource.CurrentItemChanged += BindingSource_CurrentItemChanged; if ((ScrollIndex >= 0) && (dataGridInvestProject.Rows.Count > 0)) { dataGridInvestProject.FirstDisplayedScrollingRowIndex = ScrollIndex; } if (BookMarkInvestProject != 0) { dataGridInvestProject.Rows[BookMarkInvestProject].Selected = true; bindingSource.Position = BookMarkInvestProject; } else { if (bindingSource.Count > 0) { bindingSource.MoveNext(); bindingSource.MoveFirst(); } //dataGridInvestProject.Rows[1].Selected = true; } }
private void btnNext_Click(object sender, EventArgs e) { //if (num < ds.Tables["ProductAreana"].Rows.Count-1) num++; //setProduct(num); bs.MoveNext(); setProduct(bs.Position); }
private bool TinhSLphongDaCheck() { int[] selected = gridView1.GetSelectedRows(); if (selected.Length == 0) { return(false); } if (_data.tDSPhong.Rows.Count == 0) { return(false); } bool hoanthanh = _data.TinhSLPhongDaCheck(); DataRow Mdr = _data.tDSPhong.Rows[selected[0]]; if (selected[0] < _data.tDSPhong.Rows.Count - 1 && int.Parse(Mdr["Conlai"].ToString()) <= 0) { bsDSPhong.MoveNext(); gridView1.RefreshData(); gridView1.RefreshEditor(true); return(false); } else if (selected[0] == _data.tDSPhong.Rows.Count - 1 && hoanthanh) { return(true); } else { return(false); } }
private void btnNext_Click(object sender, EventArgs e) { /*if (num < ds.Tables["Custormer"].Rows.Count - 1) num++; * setCustomer(num);*/ bs.MoveNext(); setCustomer(bs.Position); }
/// <summary> /// Метод заполнение узлов /// </summary> /// <param name="parentid"></param> /// <param name="filter"></param> /// <param name="sort"></param> /// <param name="table"></param> private void FillTreeView(TreeView treeView, BindingSource bindingSource) { treeView.Nodes.Clear(); bindingSource.Position = 0; for (int i = 0; i < bindingSource.Count; i++) { //Application.DoEvents(); DataRow dr = (bindingSource.Current as DataRowView).Row; int id = Convert.ToInt32(dr["id"]); int?parent_id = null; try { parent_id = Convert.ToInt32(dr["ParentID"]); } catch { } string name = string.Empty; name = dr["NodeText"].ToString(); bool nodeType = (bool)dr["NodeType"]; if (parent_id == null) { treeView.Nodes.Add(FillNode(nodeType, id, name)); } else { TreeNode[] treeNodes = treeView.Nodes.Find(parent_id.ToString(), true); if (treeNodes.Length != 0) { (treeNodes.GetValue(0) as TreeNode).Nodes.Add(FillNode(nodeType, id, name)); } } bindingSource.MoveNext(); } }
public ResponseOptionUsage(string fieldname, string respName) { InitializeComponent(); ResponseSets = DBAction.GetResponseSets(fieldname); bs = new BindingSource { DataSource = ResponseSets }; bs.ListChanged += Bs_ListChanged; navWordings.BindingSource = bs; this.MouseWheel += WordingUsage_MouseWheel; // navigate to wordID foreach (ResponseSet r in ResponseSets) { if (r.RespSetName != respName) { bs.MoveNext(); } else { break; } } }
public static void Updatetable(SqlDataAdapter dax, DataTable dtx, BindingSource bsx) { var ci = bsx.Position; if (ci > 0) { bsx.MovePrevious(); bsx.MoveNext(); } else { bsx.MovePrevious(); } try { cb = new SqlCommandBuilder(dax); cb.GetUpdateCommand(); dax.Update(dtx); dax.SelectCommand.CommandTimeout = 300; dtx.AcceptChanges(); cb.Dispose(); } catch (OleDbException err) { MessageBox.Show("ERROR:" + err.Source + " " + err.Message, "ERROR"); return; } //catch { MessageBox.Show("Can not Save! Please check again"); } }
public WordingUsage(string fieldname, int wordID) { InitializeComponent(); Wordings = DBAction.GetWordings(fieldname); bs = new BindingSource { DataSource = Wordings }; bs.ListChanged += Bs_ListChanged; navWordings.BindingSource = bs; this.MouseWheel += WordingUsage_MouseWheel; // navigate to wordID foreach (Wording w in Wordings) { if (w.WordID != wordID) { bs.MoveNext(); } else { break; } } }
private void toolStripButton3_Click(object sender, EventArgs e) { if (_bindingSource != null) { _bindingSource.MoveNext(); } }
//【二、当系统读取到条形码开始将商品加入购物车】 //1.如果购物车中没有该商品,在购物车中新建一栏加入 //2.如果购物车中该商品已经存在了,直接改变购物车中该商品的数量 private void TxtProductId_KeyDown(object sender, KeyEventArgs e) { //在键盘按下事件中,必须要判断按下的功能键是什么 //【1】按下回车进行商品编号的录入,进入商品添加功能 if (e.KeyCode == Keys.Enter) { BindProduct(); } //【2】按上移动 else if (e.KeyCode == Keys.Up) { if (dgvProductList.RowCount == 0 || dgvProductList.RowCount == 1) { return; } bs.MovePrevious(); } //【3】按下移动 else if (e.KeyCode == Keys.Down) { if (dgvProductList.RowCount == 0 || dgvProductList.RowCount == 1) { return; } bs.MoveNext(); } //【4】按下Del键移除 else if (e.KeyCode == Keys.Delete) { if (dgvProductList.RowCount == 0) { return; } bs.RemoveCurrent(); //问题:1.数据表要刷新 //问题:2.更新序号 dgvProductList.DataSource = null; dgvProductList.DataSource = bs; } //【5】按下的是A键开始结算 else if (e.KeyCode == Keys.A) { if (dgvProductList.RowCount == 0) { return; } else { Balance(); } } //【6】按下的是退出系统按键 else if (e.KeyCode == Keys.Escape) { if (MessageBox.Show("是否确认关闭系统", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { this.Close(); } } }
private void btn_Next_Click(object sender, EventArgs e) { ///this returns examBindingSource.Count=15 question and will //that the questions would move after each other correctley if (tos == 13) { btnSubmit.Enabled = true; btn_Next.Enabled = false; } if ((StudentAnswer.Count == tos) && (StudentAnswer.Count < 15)) { if (rdoChoice1.Checked == true) { StudentAnswer.Add(rdoChoice1.Text + StudentAnswer.Count); } else if (rdoChoice2.Checked == true) { StudentAnswer.Add(rdoChoice2.Text + StudentAnswer.Count); } else if (rdoChoice3.Checked == true) { StudentAnswer.Add(rdoChoice3.Text + StudentAnswer.Count); } else if (rdoChoice4.Checked == true) { StudentAnswer.Add(rdoChoice4.Text + StudentAnswer.Count); } } tos++; if (StudentAnswer.Count > (tos - 1)) { if (rdoChoice1.Checked == true) { StudentAnswer[tos - 1] = rdoChoice1.Text + (tos - 1); } else if (rdoChoice2.Checked == true) { StudentAnswer[tos - 1] = rdoChoice2.Text + (tos - 1); } else if (rdoChoice3.Checked == true) { StudentAnswer[tos - 1] = rdoChoice3.Text + (tos - 1); } else if (rdoChoice4.Checked == true) { StudentAnswer[tos - 1] = rdoChoice4.Text + (tos - 1); } } examBindingSource.Filter = "Qchoice LIKE 'a)%'"; examBindingSource.MoveNext(); bindingQuestions(); if (StudentAnswer.Count > tos - 1) { checkPreviousAnswers(); } //if (tos > 15) //{ // tos = 15; //} }
/// <summary> /// 焦点位于控件上时的按键事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TxtProductId_KeyDown(object sender, KeyEventArgs e) { //退出系统按键//查询商品编号对应商品 if (e.KeyCode == Keys.Escape) { if (MessageBox.Show("是否确认关闭系统", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { this.Close(); } } //商品添加 else if (e.KeyCode == Keys.Enter) { BindProduct(); } //向上移动 else if (e.KeyCode == Keys.Up) { if (dgvProductList.RowCount == 0 || dgvProductList.RowCount == 1) { return; } bs.MovePrevious(); } //向下移动 else if (e.KeyCode == Keys.Down) { if (dgvProductList.RowCount == 0 || dgvProductList.RowCount == 1) { return; } bs.MoveNext(); } //移除数据 else if (e.KeyCode == Keys.Delete) { if (dgvProductList.RowCount == 0) { return; } bs.RemoveCurrent(); //刷新数据表 dgvProductList.DataSource = null; //更新序号 dgvProductList.DataSource = bs; } //F1键结算 else if (e.KeyCode == Keys.F1) { if (dgvProductList.RowCount == 0) { return; } else { Balance(); } } }
private void button1_Click(object sender, EventArgs e) { if (myBinding.Position + 1 < myBinding.Count) { myBinding.MoveNext(); textBoxProduct.Clear(); } }