示例#1
0
        public void savePollingGroupProps(PollingGroupProps pollingGroupProps, int id)
        {
            var serProps = json.Serialize(pollingGroupProps);
            var sel      = context.Properties.Where(c => c.ObjectId == id && c.PropId == 0).FirstOrDefault();

            sel.Value = serProps;
            context.SaveChanges();
        }
示例#2
0
        public PollingGroupProps getPollingGroupProps(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 PollingGroupProps();
            string JSONprop = sel1.Value;
            var    propsDes = json.Deserialize(JSONprop, Props.GetType());

            Props      = (PollingGroupProps)propsDes;
            Props.Id   = id;
            Props.Name = sel2.Name;
            return(Props);
        }
示例#3
0
 public ActionResult EditPollingGroupProps(PollingGroupProps model)
 {
     if (ModelState.IsValid)
     {
         var IdForSave = model.Id;
         tagConfigurator.savePollingGroupProps(model, IdForSave);
         ViewBag.Notification = 1;
     }
     else
     {
         ViewBag.Notification = 0;
     }
     return(PartialView("PollingGroupPartial", model));
 }
示例#4
0
        public ActionResult EditPollingGroupProps(PollingGroupProps model)
        {
            if (ModelState.IsValid)
            {
                var IdForSave = model.Id;
                tagConfigurator.savePollingGroupProps(model, IdForSave);
                ViewBag.Notification = 1;
            }
            else
            {
                ViewBag.Notification = 0;
            }
            ViewBag.ActiveModules = tagConfigurator.GetConnectedModules();
            var userProps = tagConfigurator.getUserProps(model.Id);

            ViewBag.UserProps = userProps;
            return(PartialView("PollingGroupPartial", model));
        }