Пример #1
0
 private void LoadStockDefects()
 {
     ProcessErrorGoodsEventArgs eventArgs = new ProcessErrorGoodsEventArgs();
     EventUtility.fireEvent(LoadAllStockDefects,this,eventArgs);
     IList list = eventArgs.StockList;
     if(list ==null)
     {
         return;
     }
     stockDefectList.Clear();
     foreach (Stock defect in list)
     {
         stockDefectList.Add(defect);
     }
     bdsStockDefect.EndEdit();
     dgvStockDefect.Refresh();
     dgvStockDefect.Invalidate();
 }
Пример #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if(!CheckIntegrityData())
     {
         return;
     }
     ProcessErrorGoodsEventArgs eventArgs = new ProcessErrorGoodsEventArgs();
     if (!DepartmentProcessing)
     {
         eventArgs.ReturnStockOutList = ObjectConverter.ConvertToNonGenericList(returnGoodsList);
         eventArgs.TempStockOutList = ObjectConverter.ConvertToNonGenericList(tempStockOutList);
         eventArgs.DestroyUnusedGoodsList = ObjectConverter.ConvertToNonGenericList(destroyGoodsList);
         eventArgs.StockList = ObjectConverter.ConvertToNonGenericList(stockDefectList);
         EventUtility.fireEvent(SaveStockDefects, this, eventArgs);
     }
     else
     {
         eventArgs.ReturnStockOutList = ObjectConverter.ConvertToNonGenericList(deptReturnGoodsList);
         eventArgs.TempStockOutList = ObjectConverter.ConvertToNonGenericList(deptTempStockOutList);
         eventArgs.DestroyUnusedGoodsList = ObjectConverter.ConvertToNonGenericList(deptDestroyGoodsList);
         eventArgs.StockList = ObjectConverter.ConvertToNonGenericList(deptStockDefectList);
         EventUtility.fireEvent(SaveDepartmentStockDefects, this, eventArgs);
     }
     if(!eventArgs.HasErrors)
     {
         MessageBox.Show("Lưu thành công !");
         ClearForm();
         if(!DepartmentProcessing)
         {
             LoadStockDefects();
         }
         else
         {
             LoadDepartmentStockDefects();
         }
     }
 }
 void processErrorGoodsView_SaveDepartmentStockDefects(object sender, ProcessErrorGoodsEventArgs e)
 {
     DepartmentStockOutLogic.ProcessErrorGoods(e.StockList, e.ReturnStockOutList, e.TempStockOutList,
                                            e.DestroyUnusedGoodsList);
 }
        void processErrorGoodsView_SaveStockDefects(object sender, ProcessErrorGoodsEventArgs e)
        {
            try
            {
                StockOutLogic.ProcessErrorGoods(e.StockList, e.ReturnStockOutList, e.TempStockOutList,
                                                    e.DestroyUnusedGoodsList);
                e.HasErrors = false;

            }
            catch (System.Exception ex)
            {
                e.HasErrors = true;
            }
        }
 void processErrorGoodsView_LoadAllStockDefects(object sender, ProcessErrorGoodsEventArgs e)
 {
     IList stockDefectList = StockLogic.FindAllErrors();
     e.StockList = stockDefectList;
 }