public object GetCreateModel()
        {
            var m = new TLedWindowModel();

            m.ControllerID = controllerId;
            return(m);
        }
 public ActionResult SubmitForm(TLedWindowModel model)
 {
     if (model.ID == -1)
     {
         this.ledWinBll.Insert(model);
     }
     else
     {
         this.ledWinBll.Update(model);
     }
     return(Content("操作成功!"));
 }
        public ActionResult Form(int id)
        {
            var model = this.ledWinBll.GetModel(id);

            if (model == null)
            {
                model = new TLedWindowModel()
                {
                    ID           = -1,
                    ControllerID = Convert.ToInt32(this.Request["ctlId"])
                }
            }
            ;
            var ctlModel = this.lcBll.GetModel(p => p.ID == model.ControllerID);

            this.ViewBag.ControllerName = ctlModel == null ? "" : ctlModel.Name;
            var winModel = this.windowBll.GetModel(p => p.Number == model.WindowNumber);

            this.ViewBag.WinName = winModel == null ? "" : winModel.Name;
            this.ViewBag.WinList = JsonConvert.SerializeObject(this.windowBll.GetModelList());
            return(View(model));
        }
 public int Delete(TLedWindowModel model)
 {
     return(this.db.Delete(model));
 }
 public int Update(TLedWindowModel model)
 {
     return(this.db.Update(model));
 }
 public TLedWindowModel Insert(TLedWindowModel model)
 {
     return(db.Insert(model));
 }
 public TLedWindowModel Insert(TLedWindowModel model)
 {
     return(this.dal.Insert(model));
 }