public void saveOPCProps(OPCProps opcProps, int id) { var serProps = json.Serialize(opcProps); var sel = context.Properties.Where(c => c.ObjectId == id && c.PropId == 0).FirstOrDefault(); sel.Value = serProps; context.SaveChanges(); }
public OPCProps getOPCProps(int id) { var sel1 = context.Properties.AsNoTracking().Where(c => c.ObjectId == id && c.PropId == 0).FirstOrDefault(); var sel2 = context.Objects.Find(id); var Props = new OPCProps(); string JSONprop = sel1.Value; var propsDes = json.Deserialize(JSONprop, Props.GetType()); Props = (OPCProps)propsDes; Props.Id = id; Props.Name = sel2.Name; return(Props); }
public ActionResult EditOPCProps(OPCProps model) { if (ModelState.IsValid) { var IdForSave = model.Id; tagConfigurator.saveOPCProps(model, IdForSave); ViewBag.Notification = 1; } else { ViewBag.Notification = 0; } return(PartialView("OPCPartial", model)); }
public ActionResult EditOPCProps(OPCProps model) { if (ModelState.IsValid) { var IdForSave = model.Id; tagConfigurator.saveOPCProps(model, IdForSave); ViewBag.Notification = 1; } else { ViewBag.Notification = 0; } var userProps = tagConfigurator.getUserProps(model.Id); ViewBag.UserProps = userProps; ViewBag.ActiveModules = tagConfigurator.GetConnectedModules(); return(PartialView("OPCPartial", model)); }