private void CurrentOrdersForm_Load(object sender, EventArgs e) { if ((user.GetType() == typeof(Client))) { col_customer.Visible = false; ms_delete.Visible = false; Client client = (Client)user; for (int i = 0; i < client.services.Count; i++) { if (client.FullName == client.services[i].customer) { dgv_service.Rows.Add(client.services[i].service, client.services[i].price, client.services[i].priceForVIP, client.services[i].leadTime, client.services[i].status, client.services[i].customer); } } } else { col_status.ReadOnly = false; col_price.ReadOnly = false; col_priceForVIP.ReadOnly = false; col_order.ReadOnly = false; col_leadTime.ReadOnly = false; col_customer.ReadOnly = false; Administration admin = (Administration)user; ExcelService excel = new ExcelService(); string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\Information System For Car Service\\Information System.xls"; excel.OpenDocument(path); excel.ReadCurrentOrders(admin); excel.CloseDocument(); for (int i = 0; i < admin.services.Count; i++) { dgv_service.Rows.Add(admin.services[i].service, admin.services[i].price, admin.services[i].priceForVIP, admin.services[i].leadTime, admin.services[i].status, admin.services[i].customer); } } }
private void modeForm(User user) { if (user.GetType() == typeof(Client)) { this.user = (Client)user; bt_сlientBase.Visible = false; bt_registration.Visible = false; lb_fullName.Text = "Приветствуем вас, " + user.FullName; Client client = (Client)this.user; ExcelService excel = new ExcelService(); string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\Information System For Car Service\\Information System.xls"; excel.OpenDocument(path); excel.ReadCurrentOrders(user); excel.CloseDocument(); } else { this.user = (Administration)user; lb_fullName.Text = "Приветствуем вас, " + user.FullName; } }