public ListOrder() { InitializeComponent(); dataAccess = new DataAccess(); this.Load += (s, e) => LoadDataToGrid(); }
public CustomersForm() { InitializeComponent(); dataAccess = new DataAccess(); this.Load += (s, e) => LoadDataToGrid(); exitButton.Click += (s, e) => Close(); }
public LoginForm() { InitializeComponent(); dataAccess = new DataAccess(); usernameTextEdit.Enter += (s, e) => usernameTextEdit.SelectAll(); passwordTextEdit.Enter += (s, e) => passwordTextEdit.SelectAll(); exitButton.Click += (s, e) => Close(); }
public AccountDetailsForm(string username) { InitializeComponent(); dataAccess = new DataAccess(); exitButton.Click += (s, e) => Close(); this.username = username; GetDetails(); }
public ProductsForm() { InitializeComponent(); dataAccess = new DataAccess(); this.Load += (s, e) => LoadDataToGrid(); exitButton.Click += (s, e) => Close(); unitPriceColumn.DisplayFormat.FormatType = FormatType.Custom; unitPriceColumn.DisplayFormat.FormatString = "c"; }
private void LoadDataToGrid() { DateTime fromDate = ngayBatDauDTPicker.Value, toDate = ngayKetThucDTPicker.Value; var dataAccess = new DataAccess(); try { pivotGridControl.DataSource = dataAccess.TableReturnFromProcedure10NhanVienBanDuocNhieuHangNhat(fromDate, toDate); } catch (SqlException) { MessageBox.Show("An error has occured while trying to connect to server.", "Error"); } }
private void LoadDataToGrid() { DateTime fromDate = ngayBatDauDTPicker.Value, toDate = ngayKetThucDTPicker.Value; var dataAccess = new DataAccess(); var procedureName = "[ProcedureStatistics]"; try { pivotGridControl.DataSource = dataAccess.ExecuteProcedure(procedureName, fromDate, toDate); } catch (SqlException) { MessageBox.Show("An error has occured while trying to connect to server.", "Error"); } }
private void comboBoxCustomerPhone_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxCustomerPhone.SelectedValue != null) { decimal ID_khach_hang = Convert.ToDecimal(comboBoxCustomerPhone.SelectedValue.ToString()); if (ID_khach_hang <= 0) { lastNameTxt.Text = ""; firstNameTxt.Text = ""; addressTxt.Text = ""; dateOfBirthDAT.Value= DateTime.Now; return; } dataAccess = new DataAccess(); DataRow DataRowDetail = dataAccess.SelectCustomers(ID_khach_hang); lastNameTxt.Text = DataRowDetail["LastName"].ToString(); firstNameTxt.Text = DataRowDetail["FirstName"].ToString(); addressTxt.Text = DataRowDetail["Address"].ToString(); dateOfBirthDAT.Value = Convert.ToDateTime(DataRowDetail["DateOfBirth"].ToString()); // load_data_2_grid_khach_hang_don_hang(); } }
private void NewOrderForm_Load(object sender, EventArgs e) { dataAccess = new DataAccess(); comboBoxCustomerPhone.DisplayMember = "Phone"; comboBoxCustomerPhone.ValueMember = "CustomerID"; DataTable dt = dataAccess.SelectCustomers(); dt.Rows.Add(-1, "Nhập số điện thoại"); comboBoxCustomerPhone.DataSource = dt; comboBoxCustomerPhone.SelectedValue = -1; OrderDetailTable = new DataTable(); OrderDetailTable.Columns.Add("ProductID"); OrderDetailTable.Columns.Add("Product"); OrderDetailTable.Columns.Add("UnitPrice"); OrderDetailTable.Columns.Add("Quantity"); OrderDetailTable.Columns.Add("Discount"); gridControl.DataSource = OrderDetailTable; //productLookUpEdit.DataSource = dataAccess.SelectProductNames(); //productLookUpEdit.DisplayMember = "ProductName"; //productLookUpEdit.ValueMember = "ProductID"; }
private CategoryDetailsForm() { InitializeComponent(); dataAccess = new DataAccess(); }
private ProductDetailsForm() { InitializeComponent(); dataAccess = new DataAccess(); }
private SupplierDetailsForm() { InitializeComponent(); dataAccess = new DataAccess(); }
private void productLookUpEdit_EditValueChanged(object sender, EventArgs e) { dataAccess = new DataAccess(); decimal id = (decimal)grv.GetRowCellValue(grv.FocusedRowHandle, "Product"); grv.SetRowCellValue(grv.FocusedRowHandle, "UnitPrice",dataAccess.SelectUnnitPrice(id)); }
private void LoadDataToGrid() { DataAccess da = new DataAccess(); pivotGridControl.DataSource = da.TableReturnFromProcedure10NhanVienBanDuocNhieuTienNhat(ngayBatDauDTPicker.Value, ngayKetThucDTPicker.Value); }
private CustomerDetailsForm() { InitializeComponent(); dataAccess = new DataAccess(); }