public int Add(VcrFile mdl) { using (_dbContext = new ApplicationDbContext()) { _dbContext.TrainVcrFiles.Add(mdl); return(_dbContext.SaveChanges()); } }
public int DelFile(string id) { if (string.IsNullOrEmpty(id)) { return(0); } VcrFile vcrFile = Single(id); if (Common.Utility.FileExists(vcrFile.Path)) { Common.Utility.DeleteFile(vcrFile.Path); } return(Del(id)); }
public int Update(VcrFile mdl) { _sb = new StringBuilder(); _sb.Append(@"UPDATE VcrFiles SET VcrId = VcrId, Name = Name, Path = Path, FileOk = FileOk "); _sb.Append(" Where Id=@Id"); var parmlist = Wyb.DbUtility.TableToModel <VcrFile> .FillDbParams(mdl, DbConfig.DbProviderType.SqlServer); dbFunc.ConnectionString = connstr; return(dbFunc.ExecuteNonQuery(_sb.ToString(), parmlist.ToArray())); //throw new NotImplementedException(); }
public int Update(VcrFile mdl) { return(_dbFunc.Update(mdl)); }
public int Update(VcrFile mdl) { return(vcrFileDAL.Update(mdl)); }