예제 #1
0
 public int Add(VcrFile mdl)
 {
     using (_dbContext = new ApplicationDbContext())
     {
         _dbContext.TrainVcrFiles.Add(mdl);
         return(_dbContext.SaveChanges());
     }
 }
예제 #2
0
        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));
        }
예제 #3
0
        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();
        }
예제 #4
0
 public int Update(VcrFile mdl)
 {
     return(_dbFunc.Update(mdl));
 }
예제 #5
0
 public int Update(VcrFile mdl)
 {
     return(vcrFileDAL.Update(mdl));
 }