private void FormCreateSale_Load(object sender, EventArgs e) { dateTimePicker1.Value = DateTime.Now; tbSalesman.Text = InfoShareDLL.GetStaffName(); lbSaleNumber.Text = "XSD" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Millisecond.ToString(); sumPrice = 0.0; tbTotalPrice.Text = sumPrice.ToString("f") + "元"; DataBaseOperationDLL dl = new DataBaseOperationDLL(); //将支付方式绑定到支付方式文本框 list = dl.GetDataInformation("payment_table", "payment_name");//从数据库中获取支付方式 foreach (string str in list) { cbPayment.Items.Add(str); Console.WriteLine(str); } //将单位绑定到单位文本框 list = dl.GetDataInformation("quantifier_table", "quantifier_name");//从数据库中获取单位名称 foreach (string str in list) { cbQuantifier.Items.Add(str); } }
private void FormCreateSale_Load(object sender, EventArgs e) { dateTimePicker1.Value = (DateTime)salesRow.Cells["time"].Value; tbSalesman.Text = salesRow.Cells["saleMan"].Value.ToString(); tbCustomer.Text = salesRow.Cells["customerName"].Value.ToString(); tbSalesman.Text = salesRow.Cells["saleMan"].Value.ToString(); cbPayment.Text = salesRow.Cells["paymentName"].Value.ToString(); lbSaleNumber.Text = salesRow.Cells["saleNumber"].Value.ToString(); sumPrice = double.Parse(salesRow.Cells["tatolPrice"].Value.ToString()); tbTotalPrice.Text = sumPrice.ToString("f") + "元"; //将支付方式绑定到支付方式文本框 list = db.GetDataInformation("payment_table", "payment_name");//从数据库中获取支付方式 foreach (string str in list) { cbPayment.Items.Add(str); } //将单位绑定到单位文本框 list = db.GetDataInformation("quantifier_table", "quantifier_name");//从数据库中获取单位名称 foreach (string str in list) { cbQuantifier.Items.Add(str); } dt = db.GetSalesDetails(lbSaleNumber.Text); dataGridView1.DataSource = dt; }
private void FormInsertStock_Load(object sender, EventArgs e) { //将单位绑定到单位文本框 List <string> list1 = db.GetDataInformation("quantifier_table", "quantifier_name");//从数据库中获取单位名称 foreach (string str in list1) { cbbQuantifier.Items.Add(str); } List <string> list2 = db.GetDataInformation("category_table", "category_name");//从数据库中获取类型名称 foreach (string str in list2) { cbType.Items.Add(str); } }
private void FormInsertStaff_Load(object sender, EventArgs e) { List <string> list1 = db.GetDataInformation("department_table", "department_name");//从数据库中获取单位名称 foreach (string str in list1) { cbDepartment.Items.Add(str); } }