public ActionResult _Insert(GridCommand command,  CreateOrderCode createOrderCode)
 {
     if (ModelState.IsValid)
     {
         IList<CreateOrderCode> CreateOrderByCode = base.genericMgr.FindAll<CreateOrderCode>("from CreateOrderCode as f where f.Code=?", createOrderCode.Code);
         if (CreateOrderByCode.Count > 0)
         {
             SaveErrorMessage("代码已经存在");
            
         }
         else
         {
             base.genericMgr.Create(createOrderCode);
             SaveSuccessMessage("新增成功。");
         }
     }
     CreateOrderSearchModel searchModel = TempData["CreateOrderSearchModel"] != null ? TempData["CreateOrderSearchModel"] as CreateOrderSearchModel : new CreateOrderSearchModel();
     TempData["CreateOrderSearchModel"] = searchModel;
     SearchStatementModel searchStatementModel = PrepareSearchStatement(command, searchModel);
     return PartialView(GetAjaxPageData<CreateOrderCode>(searchStatementModel, command));
 }
 public ActionResult _Update(GridCommand command, CreateOrderCode CreateOrderCode, string id)
 {
     ModelState.Remove("Code");
     CreateOrderCode newCreateOrderCode = base.genericMgr.FindById<CreateOrderCode>(id);
     newCreateOrderCode.Code = id;
     newCreateOrderCode.Description = CreateOrderCode.Description;
     base.genericMgr.Update(newCreateOrderCode);
     SaveSuccessMessage("修改成功。");
     CreateOrderSearchModel searchModel = TempData["CreateOrderSearchModel"] != null ? TempData["CreateOrderSearchModel"] as CreateOrderSearchModel : new CreateOrderSearchModel();
     TempData["CreateOrderSearchModel"] = searchModel;
     SearchStatementModel searchStatementModel = PrepareSearchStatement(command, searchModel);
     return PartialView(GetAjaxPageData<CreateOrderCode>(searchStatementModel, command));
 }