void _generateOrder() { Dictionary<string, string> dict = new Dictionary<string, string>(); int assId = AssemblyOrders.getAssId(_orderNum); dict = _ASSEMBLIES.getElements(assId); xlsAssemblyOrder2 order = new xlsAssemblyOrder2(Dexcel, dict); order.createDocument(); }
void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (dGV.Rows.Count > 0) { string cell = dGV.Rows[dGV.CurrentCell.RowIndex].Cells[0].Value.ToString(); if ((sender as ComboBox).Text == "Удалить") {//доступ кладовщицы if (AccessUser.AccessUser.GetRLType(1)) { if (MessageBox.Show("Вы действительно хотите удалить лист заказа № " + cell + " ?\nУдаленная информация не может быть восстановлена!", "Предупреждение!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning).ToString() == "Yes") { AssemblyOrders.deleteOrder(cell); dGV.DataSource = Update(docStatus); MessageBox.Show("Лист заказа успешно удален!", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("У Вас нет прав на удаление Листов Заказа!"); } } else if ((sender as ComboBox).Text == "Отобразить в Excel") { if (docStatus == 1) { Dictionary<string, string> Dict = Instrumentary.setDictOrder1(cell); xlsAssemblyOrder1 Order1 = new xlsAssemblyOrder1(Dict); Order1.createDocument(); } else if (docStatus == 3) { Dictionary<string, string> Elements = new Dictionary<string, string>(); Dictionary<string, string> Dict = Instrumentary.setDictOrder2(cell, out Elements); xlsAssemblyOrder2 Order2 = new xlsAssemblyOrder2(Dict, Elements); Order2.createDocument(); } else { Dictionary<string, string> Elements = new Dictionary<string, string>(); xlsAssemblyOrder Order = new xlsAssemblyOrder(cell); Order.createDocument(); } } else if ((sender as ComboBox).Text == "Вывести ВПП") { string VPPNum = AssemblyOrders.getVPPnumber(cell); if (VPPNum != "") { VPP doc = new VPP(VPPNum); doc.createXLS(); } } else if ((sender as ComboBox).Text == "Вывести ТЗ") { string VPPNum = AssemblyOrders.getVPPnumber(cell); if (VPPNum != "") { string TZNum = dGV.Rows[dGV.CurrentCell.RowIndex].Cells["Номер ТЗ"].Value.ToString(); int TZPos = _VPP_TZ.getPosition(VPPNum, TZNum); Dictionary<string, string> Dict = Instrumentary.setDictTZ(VPPNum, TZPos); xlsTZ tzDoc = new xlsTZ(Dict); tzDoc.createDocument(); } else { string cellDocId = AssemblyOrders.getTZId(cell); if (cellDocId != "") { CreateTZ tz = new CreateTZ(1, 1, cellDocId); tz.createXLS(); } } } else if ((sender as ComboBox).Text == "Вывести спецификацию") { string cellNum = dGV["Номер", dGV.CurrentCell.RowIndex].Value.ToString(); if (!AssemblyOrders.isTZ(cellNum)) { int VPPId = AssemblyOrders.getVPPId(cellNum); string equipTitle = VPP.getEquipTitle(VPPId); _startKTC(); } } else { //доступ кладовщицы if (AccessUser.AccessUser.GetRLType(1)) { if (MessageBox.Show("Вы действительно хотите перевести листа заказа № " + cell + " на предыдущую стадию?", "Предупреждение", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning).ToString() == "Yes") { AssemblyOrders.setStatus(docStatus - 1, cell); dGV.DataSource = Update(docStatus); MessageBox.Show("Стадия изменена!", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("У Вас нет прав перевода Листа Заказа на предыдущую стадию!"); } } } }