public void saveRadioChannelProps(RadioChannelProps radioChannelProps, int id) { var serProps = json.Serialize(radioChannelProps); var sel = context.Properties.Where(c => c.ObjectId == id && c.PropId == 0).FirstOrDefault(); sel.Value = serProps; context.SaveChanges(); }
public RadioChannelProps getRadioChannelProps(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 RadioChannelProps(); string JSONprop = sel1.Value; var propsDes = json.Deserialize(JSONprop, Props.GetType()); Props = (RadioChannelProps)propsDes; Props.Id = id; Props.Name = sel2.Name; return(Props); }
public ActionResult EditRadioChannelProps(RadioChannelProps model) { if (ModelState.IsValid) { var IdForSave = model.Id; tagConfigurator.saveRadioChannelProps(model, IdForSave); ViewBag.Notification = 1; } else { ViewBag.Notification = 0; } return(PartialView("RadioChannelPartial", model)); }
public ActionResult EditRadioChannelProps(RadioChannelProps model) { if (ModelState.IsValid) { var IdForSave = model.Id; tagConfigurator.saveRadioChannelProps(model, IdForSave); ViewBag.Notification = 1; } else { ViewBag.Notification = 0; } ViewBag.ActiveModules = tagConfigurator.GetConnectedModules(); var userProps = tagConfigurator.getUserProps(model.Id); ViewBag.UserProps = userProps; return(PartialView("RadioChannelPartial", model)); }