Esempio n. 1
0
 private void editOrder_()
 {
     if ((OrdersDTO)ordersBS.Current != null)
     {
         if (((OrdersDTO)ordersBS.Current).StatusId == 1) //К поступлению
         {
             using (OrderEditFm orderEditFm = new OrderEditFm(Utils.Operation.Update, (OrdersDTO)ordersBS.Current))
             {
                 if (orderEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     int return_OrderId = orderEditFm.Return();
                     orderGridView.BeginUpdate();
                     LoadOrdersData();
                     DateTime beginDate = (DateTime)beginDateEditItem.EditValue;
                     DateTime endDate   = (DateTime)endDateEditItem.EditValue;;
                     ordersBS.DataSource  = ordersService.GetOrders(beginDate, endDate);
                     orderGrid.DataSource = ordersBS;
                     orderGridView.EndUpdate();
                     int rowHandle = orderGridView.LocateByValue("OrderId", return_OrderId);
                     orderGridView.FocusedRowHandle = rowHandle;
                     LoadReceiptsData();
                 }
             }
         }
         else
         {
             MessageBox.Show("Документ нельзя редактировать. Статус документа " + ((OrdersDTO)ordersBS.Current).StatusName, "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Esempio n. 2
0
 private void addOrder_()
 {
     using (OrderEditFm orderEditFm = new OrderEditFm(Utils.Operation.Add, new OrdersDTO()))
     {
         if (orderEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             int return_OrderId = orderEditFm.Return();
             orderGridView.BeginUpdate();
             LoadOrdersData();
             DateTime beginDate = (DateTime)beginDateEditItem.EditValue;
             DateTime endDate   = (DateTime)endDateEditItem.EditValue;
             ordersBS.DataSource  = ordersService.GetOrders(beginDate, endDate);
             orderGrid.DataSource = ordersBS;
             orderGridView.EndUpdate();
             int rowHandle = orderGridView.LocateByValue("OrderId", return_OrderId);
             orderGridView.FocusedRowHandle = rowHandle;
             LoadReceiptsData();
         }
     }
 }