private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { if (!Main.CheckUserPermission(Properties.Settings.Default.WsirConnectionString, Properties.Settings.Default.UsuarioNombre, "SolCatA", true)) { return; } b_Accion = "agregar"; OK.Text = "&Update"; Cancel.Text = "&Cancel"; //add row manually (AddNewItem = <none> in BindingNavigator) BindingSource1.AddNew(); //valores por omision //short indice = 3; ////containerType //this.DataSet1.Qds_PaymentMethods.Columns[indice].DefaultValue = 1; //this.DataGridView1.CurrentRow.Cells[indice++].Value = 1; this.Validate(); cambiarVista(); }
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { if (!Main.CheckUserPermission(Properties.Settings.Default.WsirConnectionString, Properties.Settings.Default.UsuarioNombre, "SolCatA", true)) { return; } //read next PaymentMethodID not assigned and assigned it or warn and leave int paymentMethodID = NextPaymentMethodID(); if (paymentMethodID < 1) { MessageBox.Show("No Payment Methods available to assigned."); return; } b_Accion = "agregar"; OK.Text = "&Update"; Cancel.Text = "&Cancel"; //add row manually (AddNewItem = <none> in BindingNavigator) BindingSource1.AddNew(); //valores por omision short indice = 0; //DepotID this.DataSet1.Qds_PaymentMethodsAvailableByDepot.Columns[indice].DefaultValue = depotID; this.DataGridView1.CurrentRow.Cells[indice++].Value = depotID; //PaymentMethodID this.DataSet1.Qds_PaymentMethodsAvailableByDepot.Columns[indice].DefaultValue = paymentMethodID; this.DataGridView1.CurrentRow.Cells[indice++].Value = paymentMethodID; //DepotDefault this.DataSet1.Qds_PaymentMethodsAvailableByDepot.Columns[indice].DefaultValue = 0; this.DataGridView1.CurrentRow.Cells[indice++].Value = 0; this.Validate(); cambiarVista(); }
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { if (!Main.CheckUserPermission(Properties.Settings.Default.WsirConnectionString, Properties.Settings.Default.UsuarioNombre, "SolAddCatalogues", true)) { return; } b_Accion = "agregar"; OK.Text = "&Update"; Cancel.Text = "&Cancel"; //add row manually (AddNewItem = <none> in BindingNavigator) BindingSource1.AddNew(); //valores por omision //province this.DataSet1.sol_Customers.Columns[7].DefaultValue = Main.Sol_ControlInfo.State; this.DataGridView1.CurrentRow.Cells[7].Value = Main.Sol_ControlInfo.State; //country this.DataSet1.sol_Customers.Columns[8].DefaultValue = Main.Sol_ControlInfo.Country; this.DataGridView1.CurrentRow.Cells[8].Value = Main.Sol_ControlInfo.Country; //isactive isActiveCheckBox.Checked = true; this.DataSet1.sol_Customers.Columns[12].DefaultValue = isActiveCheckBox.Checked; this.DataGridView1.CurrentRow.Cells[12].Value = isActiveCheckBox.Checked; //password this.DataSet1.sol_Customers.Columns[16].DefaultValue = String.Empty; this.DataGridView1.CurrentRow.Cells[16].Value = String.Empty; //depotId this.DataSet1.sol_Customers.Columns[17].DefaultValue = String.Empty; this.DataGridView1.CurrentRow.Cells[17].Value = String.Empty; //cardNumber this.DataSet1.sol_Customers.Columns[18].DefaultValue = String.Empty; this.DataGridView1.CurrentRow.Cells[18].Value = String.Empty; //cardTypeID this.DataSet1.sol_Customers.Columns[19].DefaultValue = 0; this.DataGridView1.CurrentRow.Cells[19].Value = 0; //CustomerType bool flag = false; if (customerType == 0) //0 = solum, 1 = quickdrop { flag = true; //true = solum false = quickdrop } //else //if(customerType == 2) //{ // this.DataSet1.sol_Customers.Columns[20].DefaultValue = false; // this.DataGridView1.CurrentRow.Cells[20].Value = false; // this.DataSet1.sol_Customers.Columns[21].DefaultValue = true; // this.DataGridView1.CurrentRow.Cells[21].Value = true; //} this.DataSet1.sol_Customers.Columns[20].DefaultValue = flag; this.DataGridView1.CurrentRow.Cells[20].Value = flag; this.DataSet1.sol_Customers.Columns[21].DefaultValue = !flag; this.DataGridView1.CurrentRow.Cells[21].Value = !flag; //25 isNew //this.DataSet1.sol_Customers.Columns[25].DefaultValue = true; ; //this.DataGridView1.CurrentRow.Cells[25].Value = true; solumCustomerCheckBox.Checked = flag; quickDropCustomerCheckBox.Checked = !flag; this.Validate(); cambiarVista(); }
private void buttonOrders_Click(object sender, EventArgs e) { if (DataGridView1.Rows.Count < 1) { return; } fieldId = (int)this.DataGridView1.CurrentRow.Cells[0].Value; if (fieldId > 0) { decimal currentBalance = 0; decimal.TryParse(this.DataGridView1.CurrentRow.Cells[22].Value.ToString(), out currentBalance); CustomerOrders f1 = new CustomerOrders( fieldId, DataGridView1.CurrentRow.Cells[1].Value.ToString(), String.Format("{0} {1}, {2} {3}, {4}, {5}", DataGridView1.CurrentRow.Cells[3].Value.ToString().Trim(), DataGridView1.CurrentRow.Cells[4].Value.ToString().Trim(), DataGridView1.CurrentRow.Cells[5].Value.ToString().Trim(), DataGridView1.CurrentRow.Cells[6].Value.ToString().Trim(), DataGridView1.CurrentRow.Cells[7].Value.ToString().Trim(), DataGridView1.CurrentRow.Cells[8].Value.ToString().Trim()), currentBalance ); //solumCustomerCheckBox.Checked = (bool)DataGridView1.CurrentRow.Cells[20].Value; //quickDropCustomerCheckBox.Checked = (bool)DataGridView1.CurrentRow.Cells[21].Value; //if (solumCustomerCheckBox.Checked // && quickDropCustomerCheckBox.Checked) // f1.customerType = -1; //both //else if (solumCustomerCheckBox.Checked) // f1.customerType = 0; //solum //else if (quickDropCustomerCheckBox.Checked) // f1.customerType = 1; //quickdrop if (DataGridView1.Columns[22].Visible) { f1.customerType = 0; //solum } else if (DataGridView1.Columns[23].Visible) { f1.customerType = 1; //quickdrop } f1.ShowDialog(); f1.Dispose(); f1 = null; //refresh this.TableAdapter1.Fill(this.DataSet1.sol_Customers, customerType, textBoxName.Text, activeType); BindingSource1.Position = BindingSource1.Find("CustomerID", fieldId); ////balance //this.DataGridView1.CurrentRow.Cells[14].Value = f1.currentBalance; ////this.DataGridView1.CurrentRow.Cells[14] = f1.currentBalance; } else { MessageBox.Show("Nothing to show!"); } }