ble (textBoxSummaryCost.Text); (order.TotalSum == 0)
{. Show ( Помилка введення даних. Сума замовлення не може бути дорівнює 0 raquo ;, Не можна додати замовлення raquo ;, MessageBoxButtons.OK, .Information) ;;
} (order.TotalSum - order.PaymentAdvance lt; 0)
{. Show ( Помилка введення даних. Сума замовлення не може бути менше передоплати raquo ;, Не можна додати замовлення raquo ;, MessageBoxButtons.OK, .Information) ;;
}. Date=Convert.ToDateTime (dateTimePickerOrder.Text) ;. BeginWorkDate=Convert.ToDateTime (dateTimePickerBeginWork.Text); (ListViewItem item in listViewServices.Items)
{. Add ((Service) item.Tag);
}. Services=services;
foreach (ListViewItem item in listViewConfiguration.Items)
{. Add ((Configuration) item.Tag);
}. Configurations=configurations;
foreach (ListViewItem item in listViewEmployees.Items)
{. Add ((Employee) item.Tag);
}. Employees=employees;
sqlOperation.AddOrder (order, services, configurations, employees, source);
if (MessageBox.Show ( Замовлення успішно доданий. Сформувати рахунок на оплату? raquo ;, Замовлення сформований raquo ;, MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
{excelAppShet=new ExcelReader (@ C: шаблони schet-na-oplatu.xls ); fileShet=System.IO.Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder. MyDocuments),
schet-na-oplatu.xls ); reportClass=new ReportClass () ;. MakeReportShetNaOplatu (excelAppShet, order) ;. SaveDocument (fileShet) ;. Diagnostics.Process.Start (fileShet) ;
}
} void buttonAddMaker_Click (object sender, EventArgs e)
{= new SelectEmployeeForm () ;. Start () ;. GetConnection (source); employees=sqlOperation.GetEmployees (source) ;. Visible=true; .listViewObjectsMakes.Items.Clear ();
for (int i=0; i lt; employees.Count; i ++)
{item=new ListViewItem ((i + 1) .ToString ()) ;. SubItems.Add (employees [i] .Surname + + employees [i] .Name + laquo ; + employees[i].Patronomic);.SubItems.Add(employees[i].Profession);.SubItems.Add(employees[i].BusinessPhone);.Tag =Employees [i] ;. listViewFindObjects.Items.Add (item) ;. listViewFindObjects.Refresh ();
}
} void addEmployeeTimer_Tick (object sender, EventArgs e)
{(selectEmployeeForm!=null)
{(selectEmployeeForm.addEmployee amp; amp;! selectEmployeeForm.Visible)
{. addEmployee=false;
for (int i=0; i lt; selectEmployeeForm.listViewObjectsMakes.Items.Count; i ++)
{item=new ListViewItem ((listViewEmployees.Items.Count + 1) .ToString ()) ;. SubItems.Add (selectEmployeeForm.listViewObjectsMakes.Items [i] .SubItems [1] .Text) ; .Tag=selectEmployeeForm.listViewObjectsMakes.Items [i] .Tag; .Items.Add (item) ;. Refresh ();
}. Close () ;. Stop ();
}
}
}
private void buttonAddService_Click (object sender, EventArgs e)
{= new AddServiceForm () ;. Start () ;. GetConnection (source); servicesCategory=sqlOperation.GetServices (source) ;. Visible=true; .listViewObjectsServices.Items.Clear () ;. categoryService=servicesCategory;
foreach (var listServices in servicesCategory.Values)
{(var service in listServices)
{item=new ListViewItem ((addServiceForm.listViewFindObjects.Items.Count + 1) .ToString ()) ;. SubItems.Add (service.Name) ;. SubItems.Add (service.Cost. ToString ()) ;. Tag=service; .listViewFindObjects.Items.Add (item) ;. listViewFindObjects.Refresh ();
}
} (var category in servicesCategory.Keys)
{. comboBoxCategory.Items.Add (category);
} (listViewServices.Items.Count gt; 0) (ListViewItem item in listViewServices.Items)
{itx=new ListViewItem ((addServiceForm.listViewObjectsServices.Items.Count + 1).ToString());.SubItems.Add(((Service)item.Tag).Name);.SubItems.Add(((Service)item.Tag).SummaryCost.ToString());.SubItems.Add(((Service)item.Tag).Count.ToString());.Tag =(Service) item.Tag; .listViewObjectsServices.Items.Add (itx);
}
} void addServiceTimer_Tick (object sender, EventArgs e)
{(addServiceForm!=null)