private void gdvCategory_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e) { try { GridView view = (GridView)sender; if (gdvCategory.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle) { int rowHandle; if (view.FocusedRowHandle == DevExpress.XtraGrid.GridControl.NewItemRowHandle) { rowHandle = view.DataRowCount - 1; } else { rowHandle = view.FocusedRowHandle; } MaterialCategoryObject category = (MaterialCategoryObject)this.gdvCategory.GetRow(rowHandle); if (category != null) { new BL.Internal.MaterialCategory().Save(category); } } } catch (System.Exception exception1) { System.Exception thisException = exception1; Management.ShowException(thisException); } }
public MaterialCateogry(PROF_IT.Common.Enumerations.TypeForm typeForm, MaterialCategoryObject materialCategory) { try { InitializeComponent(); MaterialCategoryMember = materialCategory; _typeForm = typeForm; if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm) { throw new NotImplementedException(); } else { Initialize(); InitializePropertyFormMaterialCategory(); SetPermissions(); } } catch (System.Exception exception1) { System.Exception innerException = exception1; throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public bool Remove(MaterialCategoryObject materialCategory) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "MaterialCategory_DELETE", CreateParameter("@matcatID", SqlDbType.UniqueIdentifier, materialCategory.MatcatID, ParameterDirection.Input) ); return(true); } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public void Save(MaterialCategoryObject materialCategory) { try { CheckTransaction(); new MaterialCategoryDataService(Transaction).Save(materialCategory); if (IsOwner) { Transaction.Commit(); } } catch (Exception exception1) { if (IsOwner) { Transaction.Rollback(); } Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (IsOwner) { Connection.Close(); } } }
public void Save(MaterialCategoryObject materialCategory) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "MaterialCategory_SAVE", CreateParameter("@matcatID", SqlDbType.UniqueIdentifier, materialCategory.MatcatID, ParameterDirection.InputOutput), CreateParameter("@Category", SqlDbType.VarChar, materialCategory.Category) ); materialCategory.MatcatID = (Guid)cmd.Parameters["@matcatID"].Value; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public void AddChilds(MaterialCategoryObject materialCategory) { try { Revision blRev = new Revision(); MaterialType bl = new MaterialType(); materialCategory.Types = bl.GetByCategory(materialCategory); materialCategory.Revisions = blRev.GetByMaterialCategory(materialCategory); foreach (MaterialTypeObject materialType in materialCategory.Types) { materialType.SubTypes = new MaterialSubType().GetSubTypesByType(materialType); materialType.Revisions = blRev.GetByMaterialType(materialType); materialType.ChildsAdded = true; foreach (MaterialSubTypeObject materialSubType in materialType.SubTypes) { materialSubType.Revisions = blRev.GetByMaterialSubType(materialSubType); materialSubType.ChildsAdded = true; } } materialCategory.ChildsAdded = true; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public RevisionObjectCollection GetByMaterialCategory(MaterialCategoryObject materialCategory) { RevisionObjectCollection revisions; try { revisions = new RevisionDataService().GetByMaterialCateogry(materialCategory); } catch (System.Exception exception1) { System.Exception innerException = exception1; throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException); } return(revisions); }
public MaterialTypeObjectCollection GetByCategory(MaterialCategoryObject category) { MaterialTypeObjectCollection materialTypes; try { materialTypes = new MaterialTypeDataService().GetTypesByCategorie(category); } catch (System.Exception exception1) { System.Exception innerException = exception1; throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException); } return(materialTypes); }
private void louCategory_EditValueChanged(object sender, EventArgs e) { try { if (louCategory.EditValue != null) { MaterialCategoryObject category = (MaterialCategoryObject)louCategory.EditValue; louType.Properties.DataSource = new BL.Internal.MaterialType().GetByCategory(category); } } catch (System.Exception exception1) { System.Exception thisException = exception1; Management.ShowException(thisException); } }
private void gdvCategory_DoubleClick(object sender, EventArgs e) { try { GridView view = (GridView)sender; MaterialCategoryObject obj = (MaterialCategoryObject)view.GetRow(view.FocusedRowHandle); TIS.Client.Material.MaterialCateogry materialCategory = new TIS.Client.Material.MaterialCateogry(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, obj); if (materialCategory.ShowDialog() == System.Windows.Forms.DialogResult.OK) { obj.State = PROF_IT.Common.Enumerations.ObjectState.Modified; } } catch (System.Exception excepion1) { System.Exception thisException = excepion1; Management.ShowException(thisException); } }
private void gdvCategory_InitNewRow(object sender, InitNewRowEventArgs e) { try { GridView view = (GridView)sender; MaterialCategoryObject category = (MaterialCategoryObject)view.GetRow(e.RowHandle); category.Types = new DL.Internal.MaterialType.MaterialTypeObjectCollection(); category.Revisions = new DL.Internal.Revision.RevisionObjectCollection(); category.Category = " "; new BL.Internal.MaterialCategory().Save(category); } catch (System.Exception exception1) { System.Exception thisException = exception1; Management.ShowException(thisException); } }
public RevisionObjectCollection GetByMaterialCateogry(MaterialCategoryObject materialCategory) { RevisionObjectCollection revisions = new RevisionObjectCollection(); QueryBuilder builder; try { builder = new QueryBuilder(); builder.Append(this.BaseQuery(false, 0)); builder.AppendWhereString(RevisionObject.MATCAT_ID, materialCategory.MatcatID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST); builder.Append("AND " + RevisionObject.MATCAT_ID + " is not null "); revisions = RevisionConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]); } catch (System.Exception exception1) { throw new Exception(MethodBase.GetCurrentMethod().Name, exception1); } return(revisions); }
void IEditableObject.EndEdit() { try { if (_inTxn) { _loadedMaterialCategory = MaterialCategory; _loadedMaterialType = MaterialType; _loadedMaterialSubType = MaterialSubType; _loadedRevision = Revision; _inTxn = true; } } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
private void gdvType_InitNewRow(object sender, InitNewRowEventArgs e) { try { GridView view = (GridView)sender; MaterialTypeObject type = (MaterialTypeObject)view.GetRow(e.RowHandle); MaterialCategoryObject category = (MaterialCategoryObject)gdvCategory.GetRow(gdvCategory.FocusedRowHandle); type.Type = " "; type.MaterialCategory = category; type.SubTypes = new DL.Internal.MaterialSubType.MaterialSubTypeObjectCollection(); new BL.Internal.MaterialType().Save(type); } catch (System.Exception exception1) { System.Exception thisException = exception1; Management.ShowException(thisException); } }
public MaterialTypeObjectCollection GetTypesByCategorie(MaterialCategoryObject category) { MaterialTypeObjectCollection materialTypes = new MaterialTypeObjectCollection(); QueryBuilder builder; try { builder = new QueryBuilder(); builder.Append(this.BaseQuery(false, 0)); builder.AppendWhereString(MaterialTypeObject.MATCAT_ID, category.MatcatID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST); builder.Append("AND " + MaterialTypeObject.MATCAT_ID + " is not null "); builder.AppendOrderBy(MaterialTypeObject.TYPE, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST); materialTypes = MaterialTypeConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]); } catch (System.Exception exception1) { throw new Exception(MethodBase.GetCurrentMethod().Name, exception1); } return(materialTypes); }
void IEditableObject.BeginEdit() { try { if (!_inTxn) { _loadedMaterialCategory = MaterialCategory; _loadedType = Type; //Child members _loadedSubTypes = SubTypes; _loadedRevisions = Revisions; _inTxn = true; } } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public void Remove(MaterialCategoryObject materialCategory) { try { CheckTransaction(); foreach (MaterialTypeObject type in materialCategory.Types) { foreach (MaterialSubTypeObject subType in type.SubTypes) { new MaterialSubType(Transaction).Remove(subType); } new MaterialType(Transaction).Remove(type); } Revision blREv = new Revision(Transaction); blREv.RemoveAll(materialCategory.Revisions); new MaterialCategoryDataService(Transaction).Remove(materialCategory); if (IsOwner) { Transaction.Commit(); } } catch (Exception exception1) { if (IsOwner) { Transaction.Rollback(); } Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (IsOwner) { Connection.Close(); } } }
void IEditableObject.EndEdit() { try { if (_inTxn) { _loadedMaterialCategory = MaterialCategory; _loadedMaterialType = MaterialType; _loadedMaterialSubType = MaterialSubType; _loadedEmployeeCreator = EmployeeCreator; _loadedEmployeeResponsable = EmployeeResponsable; _loadedVehicle = Vehicle; _loadedSupplier = Supplier; _loadedName = Name; _loadedDescription = Description; _loadedType = Type; _loadedSerieNumber = SerieNumber; _loadedInternalNumber = InternalNumber; _loadedPurchasedOn = PurchasedOn; _loadedPrice = Price; _loadedNextMaintenance = NextMaintenance; _loadedMaintenanceFrequency = MaintenanceFrequency; _loadedActive = Active; _loadedBroken = Broken; //Child members _loadedMemos = Memos; _loadedMaintenances = Maintenances; _inTxn = true; } } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }