Esempio n. 1
0
        public JsonResult Add(tbl_chexing model)
        {
            OperateResultModel orm = new OperateResultModel();

            orm.message = ValidInput(model);

            if (string.IsNullOrEmpty(orm.message))
            {
                UserModel um    = SessionUser;
                DateTime  dtnow = DateTime.Now;
                model.createdate = dtnow;
                model.creater    = um.UserNo;
                model.editdate   = dtnow;
                model.editer     = um.UserNo;

                CommonBll common = new CommonBll();
                orm      = common.InsertCheXing(model);
                orm.rows = model;
            }
            else
            {
                orm.success = false;
            }
            return(JsonResultHelper.ConvertToJsonResult(orm));
        }
Esempio n. 2
0
        /// <summary>
        /// 验证输入的是否正常
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        private string ValidInput(tbl_chexing model)
        {
            string msg = string.Empty;

            if (string.IsNullOrEmpty(model.chexing))
            {
                msg += "请输入编号车型<br />";
            }
            return(msg);
        }
Esempio n. 3
0
        public PartialViewResult Edit(string chexing)
        {
            tbl_chexing model = null;

            if (!string.IsNullOrEmpty(chexing))
            {
                CommonBll common = new CommonBll();
                model = common.QueryCheXing(chexing);
            }
            return(PartialView(model));
        }
Esempio n. 4
0
        /// <summary>
        /// 更新信息
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        public OperateResultModel UpdateCheXing(tbl_chexing model)
        {
            TblCheXingDal dal = new TblCheXingDal();

            return(dal.Update(model));
        }
Esempio n. 5
0
        /// <summary>
        /// 插入信息
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        public OperateResultModel InsertCheXing(tbl_chexing model)
        {
            TblCheXingDal dal = new TblCheXingDal();

            return(dal.Insert(model));
        }