public void DatabaseUpdate(TableMakerProduct item) { using (var uow = new UnitOfWork(new AppDbContext())) { uow.TableMakerProducts.Update(item); uow.Commit(); } }
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; }
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(); } }
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); }
public void SuperUpdate(TableMakerProduct item) { DatabaseUpdate(item); DomainUpdate(item); }
public void SuperAdd(TableMakerProduct item) { //FileOperation(item); DatabaseAdd(item); Items.Add(item); }