Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
        public void StorageGroupsUpdate(StorageGroupsDTO storageGroups)
        {
            var eGroup = StorageGroups.GetAll().SingleOrDefault(c => c.StorageGroupId == storageGroups.StorageGroupId);

            StorageGroups.Update((mapper.Map <StorageGroupsDTO, StorageGroups>(storageGroups, eGroup)));
        }
Ejemplo n.º 4
0
        public int StorageGroupsCreate(StorageGroupsDTO storageGroups)
        {
            var createrecord = StorageGroups.Create(mapper.Map <StorageGroups>(storageGroups));

            return((int)createrecord.StorageGroupId);
        }