Beispiel #1
0
 public Zakazchik(string ID)
 {
     InitializeComponent();
     MySqlQueries    = new MySqlQueries();
     MySqlOperations = new MySqlOperations(MySqlQueries);
     this.ID_Org     = ID;
 }
Beispiel #2
0
 public Sostav_Zakaza(MySqlQueries mySqlQueries, MySqlOperations mySqlOperations, string iD)
 {
     InitializeComponent();
     MySqlQueries    = mySqlQueries;
     MySqlOperations = mySqlOperations;
     ID = iD;
 }
Beispiel #3
0
 public Organizacii(MySqlQueries mySqlQueries, MySqlOperations mySqlOperations, string iD = null)
 {
     InitializeComponent();
     MySqlQueries    = mySqlQueries;
     MySqlOperations = mySqlOperations;
     ID = iD;
 }
 public Zakaz(MySqlQueries mySqlQueries, MySqlOperations mySqlOperations, string iD_Org = null, string iD_Zakaza = null)
 {
     InitializeComponent();
     MySqlQueries    = mySqlQueries;
     MySqlOperations = mySqlOperations;
     ID_Org          = iD_Org;
     ID_Zakaza       = iD_Zakaza;
 }
Beispiel #5
0
 public Product(MySqlQueries mySqlQueries, MySqlOperations mySqlOperations, string iD = null)
 {
     InitializeComponent();
     MySqlQueries    = mySqlQueries;
     MySqlOperations = mySqlOperations;
     ID = iD;
     MySqlOperations.Select_ComboBox(MySqlQueries.Select_Sklad_ComboBox, comboBox1);
 }
 public Zayavka(MySqlQueries mySqlQueries, MySqlOperations mySqlOperations, string iD_Zakaza = null)
 {
     InitializeComponent();
     MySqlQueries            = mySqlQueries;
     MySqlOperations         = mySqlOperations;
     ID_Zakaza               = iD_Zakaza;
     dateTimePicker1.Value   = DateTime.Now;
     dateTimePicker1.MinDate = DateTime.Now;
     dateTimePicker1.MaxDate = DateTime.Now;
 }
Beispiel #7
0
        public void Print_Zayavka(MySqlQueries mySqlQueries, DataGridView dataGridView, SaveFileDialog saveFileDialog, string ID = null)
        {
            ExcelApplication ExcelApp  = null;
            Workbooks        workbooks = null;
            Workbook         workbook  = null;
            Worksheet        worksheet = null;
            string           output    = null;
            string           fileName  = null;

            Select_Text(mySqlQueries.Select_Zayavka_PrintShapka, ref output, ID);
            saveFileDialog.Title            = "Сохранить заявку как";
            saveFileDialog.FileName         = "Заявка на отгрузку № " + output.Split(';')[0] + " (" + output.Split(';')[1] + ')';
            saveFileDialog.InitialDirectory = Application.StartupPath + "\\Отчеты\\";
            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                fileName = saveFileDialog.FileName;
                try
                {
                    ExcelApp             = new ExcelApplication();
                    workbooks            = ExcelApp.Workbooks;
                    workbook             = workbooks.Open(Application.StartupPath + "\\Blanks\\Zayavka.xlsx");
                    worksheet            = workbook.Worksheets.get_Item(1) as Worksheet;
                    ExcelApp.Cells[1, 1] = "ЗАЯВКА №" + output.Split(';')[0] + " от " + output.Split(';')[1];
                    ExcelApp.Cells[4, 2] = output.Split(';')[2];
                    ExcelApp.Cells[5, 2] = output.Split(';')[3];
                    ExcelApp.Cells[6, 2] = output.Split(';')[4];
                    ExcelApp.Cells[7, 2] = output.Split(';')[5];
                    Select_DataGridView(mySqlQueries.Select_Zayavka_PrintTable, dataGridView, ID);
                    int ExRow = 12;
                    int ExCol = 1;
                    for (int i = 0; i < dataGridView.Rows.Count; i++)
                    {
                        for (int j = 0; j < dataGridView.Columns.Count; j++)
                        {
                            ExcelApp.Cells[ExRow, ExCol] = dataGridView.Rows[i].Cells[j].Value.ToString();
                            ExCol++;
                        }
                        ExCol = 1;
                        ExRow++;
                    }
                    var cells = worksheet.get_Range("A12 ", "E" + (ExRow - 1).ToString());
                    cells.Borders[XlBordersIndex.xlInsideVertical].LineStyle   = XlLineStyle.xlContinuous;
                    cells.Borders[XlBordersIndex.xlInsideHorizontal].LineStyle = XlLineStyle.xlContinuous;
                    cells.Borders[XlBordersIndex.xlEdgeTop].LineStyle          = XlLineStyle.xlContinuous;
                    cells.Borders[XlBordersIndex.xlEdgeRight].LineStyle        = XlLineStyle.xlContinuous;
                    cells.Borders[XlBordersIndex.xlEdgeLeft].LineStyle         = XlLineStyle.xlContinuous;
                    cells.Borders[XlBordersIndex.xlEdgeBottom].LineStyle       = XlLineStyle.xlContinuous;
                    workbook.SaveAs(fileName);
                    ExcelApp.Visible = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                finally
                {
                    Marshal.ReleaseComObject(workbook);
                    Marshal.ReleaseComObject(workbooks);
                    Marshal.ReleaseComObject(ExcelApp);
                }
            }
        }
Beispiel #8
0
 public MySqlOperations(MySqlQueries sqlQueries)
 {
     this.Queries = sqlQueries;
 }
Beispiel #9
0
 public Postavschik()
 {
     InitializeComponent();
     MySqlQueries    = new MySqlQueries();
     MySqlOperations = new MySqlOperations(MySqlQueries);
 }
 public Login()
 {
     InitializeComponent();
     MySqlQueries    = new MySqlQueries();
     MySqlOperations = new MySqlOperations(MySqlQueries);
 }