public DepartmentModule() { CurrentModuleName = "Department"; CurrentModuleEntity = new DepartmentEntities(); CurrentModuleEntity.Module = this; InitializeModule(); }
public override void InitGridControlDataSource() { DepartmentEntities entity = (DepartmentEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity; BindingSource bds = new BindingSource(); bds.DataSource = entity.DepartmentRoomsList; this.DataSource = bds; }
public void ChangeDepartmentRoomBoundary() { DepartmentEntities entity = (DepartmentEntities)CurrentModuleEntity; HRDepartmentsInfo mainObject = (HRDepartmentsInfo)entity.MainObject; mainObject.HRDepartmentBoundary = (decimal)entity.DepartmentRoomsList.Sum(o => o.HRDepartmentRoomBoundary); mainObject.HRDepartmentMenBoundary = (decimal)entity.DepartmentRoomsList.Sum(o => o.HRDepartmentRoomMenBoundary); mainObject.HRDepartmentWoMenBoundary = (decimal)entity.DepartmentRoomsList.Sum(o => o.HRDepartmentRoomWoMenBoundary); entity.UpdateMainObjectBindingSource(); }
protected override void GridView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { base.GridView_CellValueChanged(sender, e); DepartmentEntities entity = (DepartmentEntities)(this.Screen.Module as BaseModuleERP).CurrentModuleEntity; if (entity.DepartmentRoomsList.CurrentIndex >= 0) { HRDepartmentRoomsInfo item = entity.DepartmentRoomsList[entity.DepartmentRoomsList.CurrentIndex]; if (e.Column.FieldName == "HRDepartmentRoomWoMenBoundary") { item.HRDepartmentRoomBoundary = item.HRDepartmentRoomMenBoundary + item.HRDepartmentRoomWoMenBoundary; ((DepartmentModule)Screen.Module).ChangeDepartmentRoomBoundary(); } if (e.Column.FieldName == "HRDepartmentRoomMenBoundary") { item.HRDepartmentRoomBoundary = item.HRDepartmentRoomMenBoundary + item.HRDepartmentRoomWoMenBoundary; ((DepartmentModule)Screen.Module).ChangeDepartmentRoomBoundary(); } } }
public void RemoveSelectedItemFromDepartmentItemList() { DepartmentEntities entity = (DepartmentEntities)CurrentModuleEntity; entity.DepartmentRoomsList.RemoveSelectedRowObjectFromList(); }
public override int ActionSave() { DepartmentEntities entity = (DepartmentEntities)CurrentModuleEntity; return(base.ActionSave()); }