Пример #1
0
        }     //End public TimelineCRUD()

        //Constructor 5
        public TimelineCRUD(WarningdetailVM poVM = null)
        {
            if (poVM != null)
            {
                //Map Form Data
                this.oVM = new TimelinedetailVM();
                this.oVM.InjectFrom(poVM);
                this.oVM.ID = poVM.TIMELINE_ID;
            } //End if (poVM != null)
        }     //End public TimelineCRUD()
Пример #2
0
 public void Update(TimelinedetailVM poViewModel)
 {
     try
     {
         using (var db = new DBMAINContext())
         {
             poViewModel.SHORT_DESC = poViewModel.FULL_DESC;
             Timeline oModel = db.Timelines.AsNoTracking().SingleOrDefault(fld => fld.ID == poViewModel.ID);
             //Map Form Data
             oModel.InjectFrom(poViewModel);
             //Set Field Header
             oModel.setFIELD_HEADER(hlpFlags_CRUDOption.UPDATE);
             //Process CRUD
             db.Entry(oModel).State = EntityState.Modified;
             db.SaveChanges();
             this.ID = oModel.ID;
         }                                                                            //End using
     }                                                                                //End try
     catch (Exception e) { isERR = true; this.ERRMSG = "CRUD - Update" + e.Message; } //End catch
 }                                                                                    //End public void Update
Пример #3
0
 public void Create(TimelinedetailVM poViewModel)
 {
     try
     {
         using (var db = new DBMAINContext())
         {
             poViewModel.SHORT_DESC = poViewModel.FULL_DESC;
             Timeline oModel = new Timeline();
             //Map Form Data
             oModel.InjectFrom(poViewModel);
             //Set Field Header
             oModel.setFIELD_HEADER(hlpFlags_CRUDOption.CREATE);
             //Process CRUD
             db.Timelines.Add(oModel);
             db.SaveChanges();
             this.ID = oModel.ID;
         }                                                                              //End using
     }                                                                                  //End try
     catch (Exception e) { isERR = true; this.ERRMSG = "CRUD - Create: " + e.Message; } //End catch
 }                                                                                      //End public void Create
Пример #4
0
 //Constructor
 public Timeline_Validation(TimelinedetailVM poViewModel)
 {
     oViewModel = poViewModel;
 } //End public Timeline_Validation()