public StorageGroupEditFm(Utils.Operation operation, StorageGroupsDTO storageGroup) { InitializeComponent(); LoadStorageGroupsData(); this.operation = operation; storageGroupsBS.DataSource = Item = storageGroup; nameTBox.DataBindings.Add("EditValue", storageGroup, "StorageGroupName"); descriptionTBox.DataBindings.Add("EditValue", storageGroup, "Description"); }
public Error.ErrorCRUD StorageGroupsDelete(StorageGroupsDTO storageGroups) { try { Error.ErrorCRUD result = CanDelete(storageGroups.StorageGroupId); if (result == Error.ErrorCRUD.CanDelete) { StorageGroups.Delete(StorageGroups.GetAll().FirstOrDefault(c => c.StorageGroupId == storageGroups.StorageGroupId)); return(Error.ErrorCRUD.NoError); } else { return(Error.ErrorCRUD.RelationError); } } catch (Exception ex) { return(Error.ErrorCRUD.DatabaseError); } }
public void StorageGroupsUpdate(StorageGroupsDTO storageGroups) { var eGroup = StorageGroups.GetAll().SingleOrDefault(c => c.StorageGroupId == storageGroups.StorageGroupId); StorageGroups.Update((mapper.Map <StorageGroupsDTO, StorageGroups>(storageGroups, eGroup))); }
public int StorageGroupsCreate(StorageGroupsDTO storageGroups) { var createrecord = StorageGroups.Create(mapper.Map <StorageGroups>(storageGroups)); return((int)createrecord.StorageGroupId); }