public MainForm() { InitializeComponent(); CustomerForm = new FrmCustomer(); ProductForm = new FrmProduct(); CategoryForm = new FrmCategory(); SellProductForm = new FrmSellProduct(); OrderForm = new FrmOrders(); SupplierForm = new FrmSupplier(); }
private void btnCustomer_Click(object sender, EventArgs e) { pnMain.Controls.Clear(); FrmCustomer frmCustomer = new FrmCustomer(); frmCustomer.TopLevel = false; pnMain.Controls.Add(frmCustomer); frmCustomer.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; frmCustomer.Dock = DockStyle.Fill; frmCustomer.Show(); }
private void button_CusMore_Click(object sender, EventArgs e) { FrmCustomer cus = new FrmCustomer(); if (cus.ShowDialog() == System.Windows.Forms.DialogResult.OK) { textBox_CusName.Tag = cus.SelectedCus.CustomerID; textBox_CusName.Text = cus.SelectedCus.CustomerName; textBox_CusPhone.Text = cus.SelectedCus.Phone; textBox_CusPID.Text = cus.SelectedCus.PID; textBox_CusAddr.Text = cus.SelectedCus.Addr; } }
public void ShowCard(BOCard model) { if (model == null) { return; } if (model is BOSupplier) { if (IsInvalid(mFrmSupplier)) { mFrmSupplier = new FrmSupplier(mApplicationController, model as BOSupplier); } else { mFrmSupplier.Model = model as BOSupplier; mFrmSupplier.UpdateView(); } SetCurrentForm(mFrmSupplier); } else if (model is BOCustomer) { if (IsInvalid(mFrmCustomer)) { mFrmCustomer = new FrmCustomer(mApplicationController, model as BOCustomer); } else { mFrmCustomer.Model = model as BOCustomer; mFrmCustomer.UpdateView(); } SetCurrentForm(mFrmCustomer); } else if (model is BOEmployee) { if (IsInvalid(mFrmEmployee)) { mFrmEmployee = new FrmEmployee(mApplicationController, model as BOEmployee); } else { mFrmEmployee.Model = model as BOEmployee; mFrmEmployee.UpdateView(); } SetCurrentForm(mFrmEmployee); } }
private void CustomerManagement(IEquatable <string> operationRequest) { using (var frmCustomer = new FrmCustomer()) { frmCustomer.CommonService = _commonService; frmCustomer.CustomerService = _customerService; if (operationRequest.Equals(Resources.OperationRequestUpdate)) { if (dgvCustomer.CurrentRow != null) { frmCustomer.Customer = _customerList[dgvCustomer.CurrentRow.Index]; } } if (frmCustomer.ShowDialog(this) == DialogResult.OK) { try { ThreadStart threadStart = UpdateControlContent; var thread = new Thread(threadStart); thread.Start(); if (operationRequest.Equals(Resources.OperationRequestInsert)) { _customerList.Add(frmCustomer.Customer); } dgvCustomer.Refresh(); SetCustomerInfo(); UpdateResultInfo(); EnableActionButton(); } catch (Exception exception) { FrmExtendedMessageBox.UnknownErrorMessage( Resources.MsgCaptionUnknownError, exception.Message); } } } SetFocusToCustomerList(); }
private void Customer_ToolStripMenuItem_Click(object sender, EventArgs e) { FrmCustomer customer = new FrmCustomer(); customer.ShowDialog(); }
public FrmAddCustomer(FrmCustomer callingForm) { mainForm = callingForm as FrmCustomer; InitializeComponent(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { FrmCustomer custumer = new FrmCustomer(); custumer.Show(); }
/// <summary> /// Show các form thông dụng theo key /// </summary> /// <param name="key"></param> private void ShowForm(string key) { CloseMdiChildrenForm(); Form fList = null; switch (key) { case TableName.Order: fList = findOpenedForm("FrmOrder"); if (fList == null) { //fList = new FrmUser(); fList.MdiParent = this; } break; case expUser: fList = findOpenedForm("FrmUser"); if (fList == null) { //fList = new FrmUser(); fList.MdiParent = this; } break; case "expReportSales": fList = findOpenedForm("frmReportSales"); if (fList == null) { fList = new frmReportSales(); fList.MdiParent = this; } break; case "expReportSalesArea": fList = findOpenedForm("frmReportSalesArea"); if (fList == null) { fList = new frmReportSalesArea(); fList.MdiParent = this; } break; case "expReportSalesCustomer": fList = findOpenedForm("frmReportSalesByCustomer"); if (fList == null) { fList = new frmReportSalesByCustomer(); fList.MdiParent = this; } break; case "expReportSalesEmployee": fList = findOpenedForm("frmReportSalesByEmployee"); if (fList == null) { fList = new frmReportSalesByEmployee(); fList.MdiParent = this; } break; case "expSellingInventory": fList = findOpenedForm("frmSellingInventory"); if (fList == null) { fList = new frmSellingInventory(); fList.MdiParent = this; } break; case expUnit: case btnUnit: fList = findOpenedForm("FrmUnit"); if (fList == null) { fList = new FrmUnit(); fList.MdiParent = this; } break; case expInventoryItemCategory: case btnInventoryItemCategory: fList = findOpenedForm("FrmInventoryItemCategory"); if (fList == null) { fList = new FrmInventoryItemCategory(); fList.MdiParent = this; } break; case expEmployee: fList = findOpenedForm("frmEmployee"); if (fList == null) { fList = new frmEmployee(); fList.MdiParent = this; } break; case expInventoryItem: case btnInventoryItem: fList = findOpenedForm("FrmInventoryItem"); if (fList == null) { fList = new FrmInventoryItem(); fList.MdiParent = this; } break; case expCustomer: case btnCustomer: fList = findOpenedForm("FrmCustomer"); if (fList == null) { fList = new FrmCustomer(); fList.MdiParent = this; } break; case expArea: case btnArea: fList = findOpenedForm("FrmArea"); if (fList == null) { fList = new FrmArea(); fList.MdiParent = this; } break; case expBooking: case btnBooking: fList = findOpenedForm("FrmBooking"); if (fList == null) { fList = new FrmBooking(); fList.MdiParent = this; } break; default: break; } fList.Show(); fList.Select(); if (Session.UserLogin.RoleName.Contains("Lễ tân")) { exbMain.Groups[0].Items[0].Visible = false; exbMain.Groups[0].Items[1].Visible = false; exbMain.Groups[0].Items[2].Visible = false; exbMain.Groups[0].Items[3].Visible = false; exbMain.Groups[1].Visible = false; exbMain.Groups[2].Visible = false; } }