GroupBox4









How do I use Group Box4
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: frmCustomerOrders.cs Copy
85         private void Button9_Click(object sender, EventArgs e)
86         {
87         DataGridView3.DataSource = null;
88         GroupBox4.Visible = false;
89         }
File name: frmCustomerOrders.cs Copy
163         private void TabControl1_Click(object sender, EventArgs e)
164         {
165             DataGridView1.DataSource = null;
166             dtpInvoiceDateFrom.Text = DateTime.Today.ToString();
167             dtpInvoiceDateTo.Text = DateTime.Today.ToString();
168             GroupBox3.Visible = false;
169             DataGridView3.DataSource = null;
170             GroupBox4.Visible = false;
171
172         }
File name: frmCustomerOrders.cs Copy
184         private void button4_Click(object sender, EventArgs e)
185         {
186             try
187             {
188                 GroupBox4.Visible = true;
189                 con = new SqlConnection(cs.DBConn);
190                 con.Open();
191                 cmd = new SqlCommand("SELECT RTRIM(invoiceNo) as [Order No],RTRIM(InvoiceDate) as [Order Date],RTRIM(Invoice_Info.CustomerID) as [Customer ID],RTRIM(CustomerName) as [Customer Name],RTRIM(SubTotal) as [SubTotal],RTRIM(VATPer) as [Vat+ST %],RTRIM(VATAmount) as [VAT+ST Amount],RTRIM(DiscountPer) as [Discount %],RTRIM(DiscountAmount) as [Discount Amount],RTRIM(GrandTotal) as [Grand Total],RTRIM(TotalPayment) as [Total Payment],RTRIM(PaymentDue) as [Payment Due],RTRIM(PaymentType) as [Payment Type],RTRIM(Status) as [Status],Remarks from Invoice_Info,Customer where Invoice_Info.CustomerID=Customer.CustomerID and Customer.CustomerID='" + txtCustomerID.Text + "' order by CustomerName,InvoiceDate", con);
192                 SqlDataAdapter myDA = new SqlDataAdapter(cmd);
193                 DataSet myDataSet = new DataSet();
194                 myDA.Fill(myDataSet, "Invoice_Info");
195                 myDA.Fill(myDataSet, "Customer");
196                 DataGridView3.DataSource = myDataSet.Tables["Customer"].DefaultView;
197                 DataGridView3.DataSource = myDataSet.Tables["Invoice_Info"].DefaultView;
198                 Int64 sum = 0;
199                 Int64 sum1 = 0;
200                 Int64 sum2 = 0;
201
202                 foreach (DataGridViewRow r in this.DataGridView3.Rows)
203                 {
204                     Int64 i = Convert.ToInt64(r.Cells[9].Value);
205                     Int64 j = Convert.ToInt64(r.Cells[10].Value);
206                     Int64 k = Convert.ToInt64(r.Cells[11].Value);
207                     sum = sum + i;
208                     sum1 = sum1 + j;
209                     sum2 = sum2 + k;
210                 }
211                 TextBox6.Text = sum.ToString();
212                 TextBox5.Text = sum1.ToString();
213                 TextBox4.Text = sum2.ToString();
214
215                 con.Close();
216             }
217             catch (Exception ex)
218             {
219                 MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
220             }
221         }
File name: frmOrder.cs Copy
668         private void Button4_Click(object sender, EventArgs e)
669         {
670             this.Hide();
671             frmSalesRecord1 frm = new frmSalesRecord1();
672             frm.DataGridView1.DataSource = null;
673             frm.dtpInvoiceDateFrom.Text = DateTime.Today.ToString();
674             frm.dtpInvoiceDateTo.Text = DateTime.Today.ToString();
675             frm.GroupBox3.Visible = false;
676             frm.DataGridView3.DataSource = null;
677             frm.cmbCustomerName.Text = "";
678             frm.GroupBox4.Visible = false;
679             frm.DateTimePicker1.Text = DateTime.Today.ToString();
680             frm.DateTimePicker2.Text = DateTime.Today.ToString();
681             frm.DataGridView2.DataSource = null;
682             frm.GroupBox10.Visible = false;
683             frm.FillCombo();
684             frm.lblUser.Text = label6.Text;
685             frm.Show();
686         }
File name: frmSales.cs Copy
670         private void Button4_Click(object sender, EventArgs e)
671         {
672             this.Hide();
673             frmSalesRecord1 frm = new frmSalesRecord1();
674             frm.DataGridView1.DataSource = null;
675             frm.dtpInvoiceDateFrom.Text = DateTime.Today.ToString();
676             frm.dtpInvoiceDateTo.Text = DateTime.Today.ToString();
677             frm.GroupBox3.Visible = false;
678             frm.DataGridView3.DataSource = null;
679             frm.cmbCustomerName.Text = "";
680             frm.GroupBox4.Visible = false;
681             frm.DateTimePicker1.Text = DateTime.Today.ToString();
682             frm.DateTimePicker2.Text = DateTime.Today.ToString();
683             frm.DataGridView2.DataSource = null;
684             frm.GroupBox10.Visible = false;
685             frm.FillCombo();
686             frm.lblUser.Text = lblUser.Text;
687             frm.lblUserType.Text = lblUserType.Text;
688             frm.Show();
689         }
File name: frmSalesRecord1.cs Copy
206         private void Button9_Click(object sender, EventArgs e)
207         {
208         DataGridView3.DataSource = null;
209         cmbCustomerName.Text = "";
210         GroupBox4.Visible = false;
211         }
File name: frmSalesRecord1.cs Copy
296         private void cmbCustomerName_SelectedIndexChanged(object sender, EventArgs e)
297         {
298               try
299             {
300             GroupBox4.Visible = true;
301             cmbCustomerName.Text = cmbCustomerName.Text.Trim();
302             con = new SqlConnection(cs.DBConn);
303             con.Open();
304             cmd = new SqlCommand("SELECT RTRIM(invoiceNo) as [Order No],RTRIM(InvoiceDate) as [Order Date],RTRIM(Invoice_Info.CustomerID) as [Customer ID],RTRIM(CustomerName) as [Customer Name],RTRIM(SubTotal) as [SubTotal],RTRIM(VATPer) as [Vat+ST %],RTRIM(VATAmount) as [VAT+ST Amount],RTRIM(DiscountPer) as [Discount %],RTRIM(DiscountAmount) as [Discount Amount],RTRIM(GrandTotal) as [Grand Total],RTRIM(TotalPayment) as [Total Payment],RTRIM(PaymentDue) as [Payment Due],RTRIM(PaymentType) as [Payment Type],RTRIM(Status) as [Status],Remarks from Invoice_Info,Customer where Invoice_Info.CustomerID=Customer.CustomerID and Customername='" + cmbCustomerName.Text.Trim() + "' order by CustomerName,InvoiceDate", con);
305             SqlDataAdapter myDA = new SqlDataAdapter(cmd);
306             DataSet myDataSet = new DataSet();
307             myDA.Fill(myDataSet, "Invoice_Info");
308             myDA.Fill(myDataSet, "Customer");
309             DataGridView3.DataSource = myDataSet.Tables["Customer"].DefaultView;
310             DataGridView3.DataSource = myDataSet.Tables["Invoice_Info"].DefaultView;
311             Int64 sum = 0;
312             Int64 sum1 = 0;
313             Int64 sum2 = 0;
314
315             foreach (DataGridViewRow r in this.DataGridView3.Rows)
316             {
317                 Int64 i = Convert.ToInt64(r.Cells[9].Value);
318                 Int64 j = Convert.ToInt64(r.Cells[10].Value);
319                 Int64 k = Convert.ToInt64(r.Cells[11].Value);
320                 sum = sum + i;
321                 sum1 = sum1 + j;
322                 sum2 = sum2 + k;
323             }
324             TextBox6.Text = sum.ToString();
325             TextBox5.Text = sum1.ToString();
326             TextBox4.Text = sum2.ToString();
327
328             con.Close();
329             }
330         catch (Exception ex)
331             {
332             MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
333             }
334         }
File name: frmSalesRecord1.cs Copy
587         private void TabControl1_Click(object sender, EventArgs e)
588         {
589             DataGridView1.DataSource = null;
590             dtpInvoiceDateFrom.Text = DateTime.Today.ToString();
591             dtpInvoiceDateTo.Text = DateTime.Today.ToString();
592             GroupBox3.Visible = false;
593             DataGridView3.DataSource = null;
594             cmbCustomerName.Text = "";
595             GroupBox4.Visible = false;
596             DateTimePicker1.Text = DateTime.Today.ToString();
597             DateTimePicker2.Text = DateTime.Today.ToString();
598             DataGridView2.DataSource = null;
599             GroupBox10.Visible = false;
600
601         }
File name: frmSalesRecord2.cs Copy
205         private void Button9_Click(object sender, EventArgs e)
206         {
207         DataGridView3.DataSource = null;
208         cmbCustomerName.Text = "";
209         GroupBox4.Visible = false;
210         }
File name: frmSalesRecord2.cs Copy
295         private void cmbCustomerName_SelectedIndexChanged(object sender, EventArgs e)
296         {
297               try
298             {
299             GroupBox4.Visible = true;
300             cmbCustomerName.Text = cmbCustomerName.Text.Trim();
301             con = new SqlConnection(cs.DBConn);
302             con.Open();
303             cmd = new SqlCommand("SELECT RTRIM(invoiceNo) as [Order No],RTRIM(InvoiceDate) as [Order Date],RTRIM(Invoice_Info.CustomerID) as [Customer ID],RTRIM(CustomerName) as [Customer Name],RTRIM(SubTotal) as [SubTotal],RTRIM(VATPer) as [Vat+ST %],RTRIM(VATAmount) as [VAT+ST Amount],RTRIM(DiscountPer) as [Discount %],RTRIM(DiscountAmount) as [Discount Amount],RTRIM(GrandTotal) as [Grand Total],RTRIM(TotalPayment) as [Total Payment],RTRIM(PaymentDue) as [Payment Due],RTRIM(PaymentType) as [Payment Type],RTRIM(Status) as [Status],Remarks from Invoice_Info,Customer where Invoice_Info.CustomerID=Customer.CustomerID and Customername='" + cmbCustomerName.Text.Trim() + "' order by CustomerName,InvoiceDate", con);
304             SqlDataAdapter myDA = new SqlDataAdapter(cmd);
305             DataSet myDataSet = new DataSet();
306             myDA.Fill(myDataSet, "Invoice_Info");
307             myDA.Fill(myDataSet, "Customer");
308             DataGridView3.DataSource = myDataSet.Tables["Customer"].DefaultView;
309             DataGridView3.DataSource = myDataSet.Tables["Invoice_Info"].DefaultView;
310             Int64 sum = 0;
311             Int64 sum1 = 0;
312             Int64 sum2 = 0;
313
314             foreach (DataGridViewRow r in this.DataGridView3.Rows)
315             {
316                 Int64 i = Convert.ToInt64(r.Cells[9].Value);
317                 Int64 j = Convert.ToInt64(r.Cells[10].Value);
318                 Int64 k = Convert.ToInt64(r.Cells[11].Value);
319                 sum = sum + i;
320                 sum1 = sum1 + j;
321                 sum2 = sum2 + k;
322             }
323             TextBox6.Text = sum.ToString();
324             TextBox5.Text = sum1.ToString();
325             TextBox4.Text = sum2.ToString();
326
327             con.Close();
328             }
329         catch (Exception ex)
330             {
331             MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
332             }
333         }

GroupBox4 122 lượt xem

Gõ tìm kiếm nhanh...