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)); }
/// <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); }
public PartialViewResult Edit(string chexing) { tbl_chexing model = null; if (!string.IsNullOrEmpty(chexing)) { CommonBll common = new CommonBll(); model = common.QueryCheXing(chexing); } return(PartialView(model)); }
/// <summary> /// 更新信息 /// </summary> /// <param name="model">实体</param> /// <returns></returns> public OperateResultModel UpdateCheXing(tbl_chexing model) { TblCheXingDal dal = new TblCheXingDal(); return(dal.Update(model)); }
/// <summary> /// 插入信息 /// </summary> /// <param name="model">实体</param> /// <returns></returns> public OperateResultModel InsertCheXing(tbl_chexing model) { TblCheXingDal dal = new TblCheXingDal(); return(dal.Insert(model)); }