} //End public void Delete_byUSR_RUID(string id) public void Create_prepare(CPARChatnotify_DetailVM poViewModel) { string vsMsgErr = ""; try { CPARChatnotify oModel = new CPARChatnotify(); //Map Form Data Mapper.CreateMap <CPARChatnotify_DetailVM, CPARChatnotify>(); oModel = Mapper.Map <CPARChatnotify_DetailVM, CPARChatnotify>(poViewModel); //Set Field Header oModel.setFIELD_HEADER(hlpFlags_CRUDOption.CREATE); //Set DTA_STS oModel.DTA_STS = valFLAG.FLAG_CRUDOPT_CREATE; this.oModel = oModel; } //End try catch (Exception e) { vsMsgErr = e.Message; } //End catch } //End public void Create
} //End public void Create public void Update(CPARChatnotify_DetailVM poViewModel) { string vsMsgErr = ""; try { using (var db = new DBMAINContext()) { CPARChatnotify oModel = db.CPARChatnotifys.AsNoTracking().SingleOrDefault(fld => fld.RUID == poViewModel.RUID); //Map Form Data Mapper.CreateMap <CPARChatnotify_DetailVM, CPARChatnotify>(); oModel = Mapper.Map <CPARChatnotify_DetailVM, CPARChatnotify>(poViewModel); //Set Field Header oModel.setFIELD_HEADER(hlpFlags_CRUDOption.UPDATE); //Process CRUD db.Entry(oModel).State = EntityState.Modified; db.SaveChanges(); } //End using } //End try catch (Exception e) { vsMsgErr = e.Message; } //End catch } //End public void Update
} //End public CPARChatnotifyCRUD() public void Create(CPARChatnotify_DetailVM poViewModel) { string vsMsgErr = ""; try { using (var db = new DBMAINContext()) { CPARChatnotify oModel = new CPARChatnotify(); //Map Form Data Mapper.CreateMap <CPARChatnotify_DetailVM, CPARChatnotify>(); oModel = Mapper.Map <CPARChatnotify_DetailVM, CPARChatnotify>(poViewModel); //Set Field Header oModel.setFIELD_HEADER(hlpFlags_CRUDOption.CREATE); //Set DTA_STS oModel.DTA_STS = valFLAG.FLAG_CRUDOPT_CREATE; //Process CRUD db.CPARChatnotifys.Add(oModel); db.SaveChanges(); } //End using } //End try catch (Exception e) { vsMsgErr = e.Message; } //End catch } //End public void Create