コード例 #1
0
ファイル: OffDayWindow.xaml.cs プロジェクト: toanitsv/Mold
        private void bwSave_DoWork(object sender, DoWorkEventArgs e)
        {
            if (insertOrUpdate == true)
            {
                OffDayController.Insert(offDay);
                offDayCurrentList.Add(offDay);

                foreach (var supp in supplierCurrentList)
                {
                    var offDayMapInsert = new OffDay_Supplier_Mapping()
                    {
                        SupplierID = supp.SupplierID,
                        OffDayID   = offDay.OffDayID
                    };
                    OffDayMapController.Insert(offDayMapInsert);
                }
            }
            if (insertOrUpdate == false)
            {
                // Update OffDay
                OffDayController.Update(offDayCurrent);

                // Delete OffDayMap
                RemoveOffDayMap(offDayCurrent.OffDayID);
                // Insert OffDayMap
                foreach (var supp in supplierCurrentList)
                {
                    var offDayMapInsert = new OffDay_Supplier_Mapping()
                    {
                        SupplierID = supp.SupplierID,
                        OffDayID   = offDayCurrent.OffDayID
                    };
                    OffDayMapController.Insert(offDayMapInsert);
                }
            }
        }
コード例 #2
0
 private void bwInsert_DoWork(object sender, DoWorkEventArgs e)
 {
     OffDayController.Insert(offDayToInsert);
 }