예제 #1
0
 public void DatabaseUpdate(TableMakerProduct item)
 {
     using (var uow = new UnitOfWork(new AppDbContext()))
     {
         uow.TableMakerProducts.Update(item);
         uow.Commit();
     }
 }
예제 #2
0
        public void DomainUpdate(TableMakerProduct item)
        {
            var edittarget = Items.SingleOrDefault(o => o.Id == item.Id);

            edittarget.Type     = item.Type;
            edittarget.FilePath = item.FilePath;
            edittarget.IsValid  = item.IsValid;
            edittarget.Project  = item.Project;
        }
예제 #3
0
 public void DatabaseAdd(TableMakerProduct item)
 {
     using (var uow = new UnitOfWork(new AppDbContext()))
     {
         item.Type    = uow.TableMakerProductTypes.GetById(item.Type.Id);
         item.Project = uow.Projects.GetById(item.Project.Id);
         uow.TableMakerProducts.Insert(item);
         uow.Commit();
     }
 }
예제 #4
0
        public void FileOperation(TableMakerProduct item)
        {
            string root             = $@"{GlobalSettings.RootPath}{item.Project.BatteryType.Name}\{item.Project.Name}";
            string temproot         = $@"{GlobalSettings.LocalFolder}{item.Project.BatteryType.Name}\{item.Project.Name}";
            string temptestfilepath = string.Empty;

            temptestfilepath = CopyToFolder(item.FilePath, temproot);
            item.FilePath    = $@"{root}\{GlobalSettings.ProductFolderName}\{Path.GetFileName(temptestfilepath)}";
            CopyToServer(temptestfilepath, item.FilePath);
        }
예제 #5
0
 public void SuperUpdate(TableMakerProduct item)
 {
     DatabaseUpdate(item);
     DomainUpdate(item);
 }
예제 #6
0
 public void SuperAdd(TableMakerProduct item)
 {
     //FileOperation(item);
     DatabaseAdd(item);
     Items.Add(item);
 }