Пример #1
0
        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));
        }
Пример #4
0
 public int Delete(TLedWindowModel model)
 {
     return(this.db.Delete(model));
 }
Пример #5
0
 public int Update(TLedWindowModel model)
 {
     return(this.db.Update(model));
 }
Пример #6
0
 public TLedWindowModel Insert(TLedWindowModel model)
 {
     return(db.Insert(model));
 }
Пример #7
0
 public TLedWindowModel Insert(TLedWindowModel model)
 {
     return(this.dal.Insert(model));
 }