GroupBox3









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

Featured Snippets


File name: frmReturn.cs Copy
96         private void btnreturn_save_Click(object sender, EventArgs e)
97         {
98             string tranid;
99
100             config.singleResult("SELECT concat(STRT,END) FROM tblautonumber WHERE ID = 6");
101             tranid = config.dt.Rows[0].Field(0);
102
103             if (txttransactionid.Text == "")
104             {
105                 MessageBox.Show("There are empty fields left that must be fill up!", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
106                 return;
107             }
108             if (dtCus_addedlist.RowCount == 0)
109             {
110                 MessageBox.Show("Cart is empty!", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
111                 return;
112             }
113
114             sql = "SELECT `ITEMID`, `QTY` FROM `tblstock_in_out` WHERE `TRANSACTIONNUMBER` ='" + txttransactionid.Text + "'";
115             config.singleResult(sql);
116
117             foreach (DataRow row in config.dt.Rows)
118             {
119                 for (int i = 0; i < dtCus_addedlist.Rows.Count; i++)
120                 {
121                     if (dtCus_addedlist.Rows[i].Cells[0].Value.ToString() == row.Field(0))
122                     {
123                         if (int.Parse(dtCus_addedlist.Rows[i].Cells[4].Value.ToString()) > row.Field(1))
124                         {
125                             MessageBox.Show("The returned quantity of the item ( " + dtCus_addedlist.Rows[i].Cells[1].Value.ToString() + " ) is greater than the available quantity of it.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
126                             return;
127                         }
128                     }
129                     if (dtCus_addedlist.Rows[i].Cells[4].Value.ToString() == "")
130                     {
131                         MessageBox.Show("Set your purpose.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
132                         return;
133                     }
134                 }
135             }
136
137             foreach (DataGridViewRow r in dtCus_addedlist.Rows)
138             {
139                 sql = "INSERT INTO `tblstock_return` ( `STOCKRETURNNUMBER`, `ITEMID`, `RETURNDATE`, `QTY`, `TOTALPRICE`, `OWNER_CUS_ID`)" +
140                         " VALUES ('" + tranid + "','" + r.Cells[0].Value + "','" + DateTime.Now.ToString("yyyy-MM-dd") + "','" + r.Cells[4].Value +
141                         "','" + r.Cells[5].Value + "','" + custormerid + "')";
142                 config.Execute_Query(sql);
143
144                 // '-----------------------------------------------update item
145                 sql = "UPDATE `tblitems` SET `QTY`=`QTY` + '" + r.Cells[4].Value + "' WHERE ITEMID='" + r.Cells[0].Value + "'";
146                 config.Execute_Query(sql);
147
148                 sql = "UPDATE `tblstock_in_out` SET `QTY`=`QTY`-'" + r.Cells[4].Value + "', `TOTALPRICE`=`TOTALPRICE`-'" + r.Cells[5].Value + "' WHERE `STOCKOUTID` ='" + r.Cells[6].Value + "'";
149                 config.Execute_Query(sql);
150             }
151
152
153             sql = "INSERT INTO `tbltransaction` (`TRANSACTIONNUMBER`, `TRANSACTIONDATE`, `TYPE`, `SUPLIERCUSTOMERID`)" +
154                   " VALUES ('" + txttransactionid.Text + "','" + DateTime.Now.ToString("yyyy-MM-dd") + "','Returned','" + custormerid + "')";
155             config.Execute_Query(sql);
156
157             // '-----------------------------------------------update autonumber
158             config.Execute_Query("UPDATE tblautonumber SET END= END + INCREMENT WHERE ID = 6");
159
160             // '------------------------------------------------------------
161             MessageBox.Show("Item(s) has been returned in the database.");
162             // '------------------------------------------------------------clearing
163             funct.clearTxt(GroupBox3);
164             dtCus_addedlist.Rows.Clear();
165
166             frmReturn_Load(sender, e);
167         }
File name: frmCustomerOrders.cs Copy
93         private void Button1_Click(object sender, EventArgs e)
94         {
95             try
96             {
97             GroupBox3.Visible = true;
98             con = new SqlConnection(cs.DBConn);
99             con.Open();
100             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 InvoiceDate between @d1 and @d2 and Customer.CustomerID='" + txtCustomerID.Text + "' order by InvoiceDate desc", con);
101             cmd.Parameters.Add("@d1", SqlDbType.DateTime, 30, "InvoiceDate").Value = dtpInvoiceDateFrom.Value.Date;
102             cmd.Parameters.Add("@d2", SqlDbType.DateTime, 30, "InvoiceDate").Value = dtpInvoiceDateTo.Value.Date;
103             SqlDataAdapter myDA = new SqlDataAdapter(cmd);
104             DataSet myDataSet = new DataSet();
105             myDA.Fill(myDataSet, "Invoice_Info");
106             myDA.Fill(myDataSet, "Customer");
107             DataGridView1.DataSource = myDataSet.Tables["Customer"].DefaultView;
108             DataGridView1.DataSource = myDataSet.Tables["Invoice_Info"].DefaultView;
109             Int64 sum = 0;
110             Int64 sum1 = 0;
111             Int64 sum2 = 0;
112
113             foreach (DataGridViewRow r in this.DataGridView1.Rows)
114             {
115                 Int64 i = Convert.ToInt64(r.Cells[9].Value);
116                 Int64 j = Convert.ToInt64(r.Cells[10].Value);
117                 Int64 k = Convert.ToInt64(r.Cells[11].Value);
118                 sum = sum + i;
119                 sum1 = sum1 + j;
120                 sum2 = sum2 + k;
121
122             }
123             TextBox1.Text = sum.ToString();
124             TextBox2.Text = sum1.ToString();
125             TextBox3.Text = sum2.ToString();
126
127             con.Close();
128             }
129         catch (Exception ex)
130             {
131             MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
132             }
133         }
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
280         private void Button2_Click(object sender, EventArgs e)
281         {
282             DataGridView1.DataSource = null;
283             dtpInvoiceDateFrom.Text = DateTime.Today.ToString();
284             dtpInvoiceDateTo.Text = DateTime.Today.ToString();
285             GroupBox3.Visible = false;
286         }
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
213         private void Button2_Click(object sender, EventArgs e)
214         {
215         DataGridView1.DataSource = null;
216         dtpInvoiceDateFrom.Text = DateTime.Today.ToString();
217         dtpInvoiceDateTo.Text = DateTime.Today.ToString();
218         GroupBox3.Visible = false;
219         }
File name: frmSalesRecord1.cs Copy
254         private void Button1_Click(object sender, EventArgs e)
255         {
256             try
257             {
258             GroupBox3.Visible = true;
259             con = new SqlConnection(cs.DBConn);
260             con.Open();
261             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 InvoiceDate between @d1 and @d2 order by InvoiceDate desc", con);
262             cmd.Parameters.Add("@d1", SqlDbType.DateTime, 30, "InvoiceDate").Value = dtpInvoiceDateFrom.Value.Date;
263             cmd.Parameters.Add("@d2", SqlDbType.DateTime, 30, "InvoiceDate").Value = dtpInvoiceDateTo.Value.Date;
264             SqlDataAdapter myDA = new SqlDataAdapter(cmd);
265             DataSet myDataSet = new DataSet();
266             myDA.Fill(myDataSet, "Invoice_Info");
267             myDA.Fill(myDataSet, "Customer");
268             DataGridView1.DataSource = myDataSet.Tables["Customer"].DefaultView;
269             DataGridView1.DataSource = myDataSet.Tables["Invoice_Info"].DefaultView;
270             Int64 sum = 0;
271             Int64 sum1 = 0;
272             Int64 sum2 = 0;
273
274             foreach (DataGridViewRow r in this.DataGridView1.Rows)
275             {
276                 Int64 i = Convert.ToInt64(r.Cells[9].Value);
277                 Int64 j = Convert.ToInt64(r.Cells[10].Value);
278                 Int64 k = Convert.ToInt64(r.Cells[11].Value);
279                 sum = sum + i;
280                 sum1 = sum1 + j;
281                 sum2 = sum2 + k;
282
283             }
284             TextBox1.Text = sum.ToString();
285             TextBox2.Text = sum1.ToString();
286             TextBox3.Text = sum2.ToString();
287
288             con.Close();
289             }
290         catch (Exception ex)
291             {
292             MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
293             }
294         }
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
212         private void Button2_Click(object sender, EventArgs e)
213         {
214         DataGridView1.DataSource = null;
215         dtpInvoiceDateFrom.Text = DateTime.Today.ToString();
216         dtpInvoiceDateTo.Text = DateTime.Today.ToString();
217         GroupBox3.Visible = false;
218         }

GroupBox3 115 lượt xem

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