public MessageModel InsertSingleEntity(BreedMaterialPicModel model) { Func <IEntityContext, string> operation = (context => { model.ModifyID = UserManagement.CurrentUser.UserID; model.ModifyName = UserManagement.CurrentUser.UserName; model.ModifyTime = DateTime.Now; context.BreedMaterialPic.Add(model); context.SaveChanges(); return(string.Empty); }); return(base.DbOperation(operation)); }
/// <summary> /// 编辑单条BreedMaterialPic /// </summary> /// <param name="model"></param> /// <returns></returns> public MessageModel UpdateSingleBreedMaterialPic(BreedMaterialPicModel model) { var data = breedMaterialPicAccess.GetOriEntity(model.PicID, model.ModifyTime); if (data == null) { return new MessageModel() { Message = "当前数据不存在或被更新,请刷新后再次操作!", Status = MessageStatus.Error } } ; return(breedMaterialPicAccess.UpdateSingleEntity(model)); } }
/// <summary> /// 插入单条BreedMaterialPic /// </summary> /// <param name="model"></param> /// <returns></returns> public MessageModel InsertSingleBreedMaterialPic(BreedMaterialPicModel model) { return(breedMaterialPicAccess.InsertSingleEntity(model)); }