private void CreateWayBill(Car car, Logic.Static.Actions action, Fields fields)
        {
            CreateDocument excelWayBill = new CreateDocument(car);

            try
            {
                excelWayBill.CreateWaybill(dtpDate.Value, null);
                excelWayBill.AddRouteInWayBill(dtpDate.Value, fields);

                if (action == Logic.Static.Actions.Print)
                {
                    excelWayBill.Print();
                }
                else
                {
                    excelWayBill.Show();
                }
            }
            catch (NullReferenceException ex)
            {
                MessageBox.Show(ex.Message, "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                excelWayBill.Exit();
            }

            if (car == list[index])
            {
                LoadWayBillCurrent();
            }
        }
Beispiel #2
0
        public InputDate(MainDGV dgvMain, Logic.Static.Actions action, WayBillType type)
        {
            InitializeComponent();

            _dgvMain = dgvMain;
            _action  = action;
            _type    = type;
        }