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