コード例 #1
0
 public void AddMarkerCat(MarkerCategory marker)
 {
     using (var context = new ManufacturingDataContext(_connectionString))
     {
         context.MarkerCategories.InsertOnSubmit(marker);
         context.SubmitChanges();
     }
 }
コード例 #2
0
        public void UpdateMarkerCat(MarkerCategory markerCategory)
        {
            var repo           = new MarkerRespository(Properties.Settings.Default.ManufacturingConStr);
            var prodRepo       = new ProductionRespository(Properties.Settings.Default.ManufacturingConStr);
            var originalMarker = repo.GetMarkerCategory(markerCategory.Id);

            prodRepo.AddNewUpdateHistory(originalMarker, markerCategory.Deleted ? "deleted" : null);
            repo.UpdateMarkerCat(originalMarker.SetOrginalDbObjToUpdated(markerCategory));
        }
コード例 #3
0
 public void UpdateMarkerCat(MarkerCategory markerCategory)
 {
     using (var context = new ManufacturingDataContext(_connectionString))
     {
         markerCategory.ModifiedOn = DateTime.Now;
         context.MarkerCategories.Attach(markerCategory);
         context.Refresh(RefreshMode.KeepCurrentValues, markerCategory);
         context.SubmitChanges();
     }
 }
コード例 #4
0
        public void AddNewMarkerCat(MarkerCategory markerCategory, Marker defaltMarker)
        {
            var repo = new MarkerRespository(Properties.Settings.Default.ManufacturingConStr);

            repo.AddMarkerCat(markerCategory);
            if (defaltMarker.NotNull())
            {
                defaltMarker.MarkerCatId = markerCategory.Id;
                AddNewMarker(defaltMarker, true);
            }
        }
コード例 #5
0
 public ActionResult AddNewMarkerCatGetMarker(MarkerCategory markerCategory, Marker defaltMarker)
 {
     AddNewMarkerCat(markerCategory, defaltMarker);
     return(GetMarkerCategory(markerCategory.Id));
 }