public void AddMarkerCat(MarkerCategory marker) { using (var context = new ManufacturingDataContext(_connectionString)) { context.MarkerCategories.InsertOnSubmit(marker); context.SubmitChanges(); } }
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)); }
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(); } }
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); } }
public ActionResult AddNewMarkerCatGetMarker(MarkerCategory markerCategory, Marker defaltMarker) { AddNewMarkerCat(markerCategory, defaltMarker); return(GetMarkerCategory(markerCategory.Id)); }