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