public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } foreach (DiagnosisCategory_Diagnosis_cu bridge in List_DiagnosisCategory_Diagnosis) { ((DiagnosisCategory_Diagnosis_cu)ActiveDBItem).DiagnosisCategory_CU_ID = bridge.DiagnosisCategory_CU_ID; ((DiagnosisCategory_Diagnosis_cu)ActiveDBItem).Diagnosis_CU_ID = bridge.Diagnosis_CU_ID; if (UserID != null) { ((DiagnosisCategory_Diagnosis_cu)ActiveDBItem).InsertedBy = Convert.ToInt32(UserID); } ((DiagnosisCategory_Diagnosis_cu)ActiveDBItem).IsOnDuty = true; switch (((IDiagnosisCategory_Diagnosis_Viewer)ActiveCollector.ActiveViewer).CommonTransactionType) { case DB_CommonTransactionType.DeleteExisting: ((DiagnosisCategory_Diagnosis_cu)ActiveDBItem).IsOnDuty = false; break; } ((DiagnosisCategory_Diagnosis_cu)ActiveCollector.ActiveDBItem).SaveChanges(); } ((DiagnosisCategory_Diagnosis_cu)ActiveCollector.ActiveDBItem).LoadItemsList(); return(true); }
public bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (MVCEditorController == null) { return(false); } if (ValidateBeforeSave(ref _message) && !CheckIfActiveDBItemExists() && BeforeSave() && MVCEditorController.SaveChanges(commonTransactionType)) { if (MVCEditorController.ActiveCollector.ActiveDBItem is TEntity) { ActiveDBEntity = (TEntity)MVCEditorController.ActiveCollector.ActiveDBItem; } if (AfterSave()) { if (_baseSearchContainer != null) { _baseSearchContainer.LoadGrid(); } } return(Close()); } MessageToView = MVCEditorController.MessageToView; return(false); }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } foreach (InventoryItem_UnitMeasurment_cu inventoryItem_UnitMeasurment in List_InventoryItem_UnitMeasurment) { ((InventoryItem_UnitMeasurment_cu)ActiveDBItem).InventoryItem_CU_ID = inventoryItem_UnitMeasurment.InventoryItem_CU_ID; ((InventoryItem_UnitMeasurment_cu)ActiveDBItem).UnitMeasurment_CU_ID = inventoryItem_UnitMeasurment.UnitMeasurment_CU_ID; if (UserID != null) { ((InventoryItem_UnitMeasurment_cu)ActiveDBItem).InsertedBy = Convert.ToInt32(UserID); } ((InventoryItem_UnitMeasurment_cu)ActiveDBItem).IsOnDuty = true; switch (((IInventoryItem_UnitMeasurment_Viewer)ActiveCollector.ActiveViewer).CommonTransactionType) { case DB_CommonTransactionType.DeleteExisting: ((InventoryItem_UnitMeasurment_cu)ActiveDBItem).IsOnDuty = false; break; } ((InventoryItem_UnitMeasurment_cu)ActiveCollector.ActiveDBItem).SaveChanges(); } ((InventoryItem_UnitMeasurment_cu)ActiveCollector.ActiveDBItem).LoadItemsList(); return(true); }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } foreach (User_UserGroup_cu user_UserGroup in List_User_UserGroup) { ((User_UserGroup_cu)ActiveDBItem).User_CU_ID = user_UserGroup.User_CU_ID; ((User_UserGroup_cu)ActiveDBItem).UserGroup_CU_ID = user_UserGroup.UserGroup_CU_ID; if (UserID != null) { ((User_UserGroup_cu)ActiveDBItem).InsertedBy = Convert.ToInt32(UserID); } ((User_UserGroup_cu)ActiveDBItem).IsOnDuty = true; switch (((IUser_UserGroup_Viewer)ActiveCollector.ActiveViewer).CommonTransactionType) { case DB_CommonTransactionType.DeleteExisting: ((User_UserGroup_cu)ActiveDBItem).IsOnDuty = false; break; } ((User_UserGroup_cu)ActiveCollector.ActiveDBItem).SaveChanges(); } ((User_UserGroup_cu)ActiveCollector.ActiveDBItem).LoadItemsList(); return(true); }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } switch (CommonTransactionType) { case DB_CommonTransactionType.CreateNew: return(((Invoice)ActiveCollector.ActiveDBItem).SaveChanges()); case DB_CommonTransactionType.UpdateExisting: InvoiceShare invoiceShare = ((Invoice)ActiveDBItem).InvoiceShare; invoiceShare.DBCommonTransactionType = commonTransactionType; invoiceShare.InvoiceID = ((Invoice)ActiveDBItem).ID; invoiceShare.SaveChanges(); if (((Invoice)ActiveDBItem).InvoicePayments != null && ((Invoice)ActiveDBItem).InvoicePayments.Count > 0) { List <InvoicePayment> invoicePayments = ((Invoice)ActiveDBItem).InvoicePayments.ToList(); } return(true); } return(false); }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } return(((InPatientRoom_cu)ActiveCollector.ActiveDBItem).SaveChanges()); }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } return(((FinanceInvoice)ActiveCollector.ActiveDBItem).SaveChanges()); }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } if (CashBoxInOutTransactionsList != null && CashBoxInOutTransactionsList.FindAll(item => Convert.ToInt32(item.AddedType).Equals(Convert.ToInt32(AddedType.NewelyAdded))).Count > 0) { foreach (CashBoxInOutTransaction cashBoxInOutTransaction in CashBoxInOutTransactionsList.FindAll(item => Convert.ToInt32(item.AddedType).Equals(Convert.ToInt32(AddedType.NewelyAdded)))) { cashBoxInOutTransaction.DBCommonTransactionType = DB_CommonTransactionType.SaveNew; cashBoxInOutTransaction.InsertedBy = Convert.ToInt32(UserID); cashBoxInOutTransaction.PaymentType_P_ID = (int)DB_PaymentType.CashPayment; cashBoxInOutTransaction.IsCancelled = false; if (UserID != null) { cashBoxInOutTransaction.InsertedBy = Convert.ToInt32(UserID); } cashBoxInOutTransaction.IsOnDuty = true; switch (((ICashBoxInOutTransactionViewer)ActiveCollector.ActiveViewer).CommonTransactionType) { case DB_CommonTransactionType.DeleteExisting: cashBoxInOutTransaction.IsOnDuty = false; break; } cashBoxInOutTransaction.SaveChanges(); } } if (CashBoxInOutTransaction.ItemsList != null && CashBoxInOutTransaction.ItemsList.FindAll(item => Convert.ToInt32(item.DBCommonTransactionType) .Equals(Convert.ToInt32(DB_CommonTransactionType.DeleteExisting))).Count > 0) { foreach (CashBoxInOutTransaction cashBoxInOutTransaction in CashBoxInOutTransaction.ItemsList.FindAll( item => Convert.ToInt32(item.DBCommonTransactionType) .Equals(Convert.ToInt32(DB_CommonTransactionType.DeleteExisting)))) { cashBoxInOutTransaction.IsOnDuty = false; cashBoxInOutTransaction.SaveChanges(); } } ((CashBoxInOutTransaction)ActiveCollector.ActiveDBItem).LoadItemsList(); return(true); }
public bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector != null) { ActiveCollector.CommonTransactionType = commonTransactionType; if (ActiveCollector.Collect(ActiveCollector) && ActiveCollector.SaveChanges(commonTransactionType)) { return(true); } } return(false); }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } //if (((RawMaterialTranasction)ActiveCollector.ActiveDBItem).SaveChanges()) //{ // ((RawMaterialTranasction)ActiveCollector.ActiveDBItem).LoadItemsList(); // return true; //} return(false); }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } if (((ServiceCategory_StationPoint_cu)ActiveCollector.ActiveDBItem).SaveChanges()) { ((ServiceCategory_StationPoint_cu)ActiveCollector.ActiveDBItem).LoadItemsList(); return(true); } return(false); }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } if (((CashBox_cu)ActiveCollector.ActiveDBItem).SaveChanges()) { ((CashBox_cu)ActiveCollector.ActiveDBItem).LoadItemsList(); return(true); } return(false); }
public static bool SaveChanges <TEntity>(this TEntity entity, DB_CommonTransactionType commonTransactionType) where TEntity : class, IDBCommon, new() { int count = 0; using (UnitOfWork.UnitOfWork unitOfWork = new UnitOfWork.UnitOfWork(DBCommon.DBContext_External)) { switch (commonTransactionType) { case DB_CommonTransactionType.UpdateExisting: count = unitOfWork.UpdateChanges(entity); break; case DB_CommonTransactionType.SaveNew: unitOfWork.GetList <TEntity>().AddEntity(entity); count = unitOfWork.SaveChanges(); break; } } return(count > 0); }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } foreach (CashBoxTransactionType_GeneralChartOfAccountType_cu itemToBeAdded in List_CashBoxTransactionType_GeneralChartOfAccountType) { ((CashBoxTransactionType_GeneralChartOfAccountType_cu)ActiveDBItem).CashBoxTransactionType_P_ID = itemToBeAdded.CashBoxTransactionType_P_ID; ((CashBoxTransactionType_GeneralChartOfAccountType_cu)ActiveDBItem).GeneralChartOfAccountType_CU_ID = itemToBeAdded.GeneralChartOfAccountType_CU_ID; if (UserID != null) { ((CashBoxTransactionType_GeneralChartOfAccountType_cu)ActiveDBItem).InsertedBy = Convert.ToInt32(UserID); } ((CashBoxTransactionType_GeneralChartOfAccountType_cu)ActiveDBItem).IsOnDuty = true; switch ( ((ICashBoxTransactionType_GeneralChartOfAccountType_Viewer)ActiveCollector.ActiveViewer).CommonTransactionType) { case DB_CommonTransactionType.DeleteExisting: ((CashBoxTransactionType_GeneralChartOfAccountType_cu)ActiveDBItem).IsOnDuty = false; break; } ((CashBoxTransactionType_GeneralChartOfAccountType_cu)ActiveCollector.ActiveDBItem).SaveChanges(); } ((CashBoxTransactionType_GeneralChartOfAccountType_cu)ActiveCollector.ActiveDBItem).LoadItemsList(); return(true); }
public void SetHeader(string headerTitle, DB_CommonTransactionType commonTransactionType) { lblTitle.Text = headerTitle; CommonTransactionType = commonTransactionType; if (!string.IsNullOrEmpty(ApplicationStaticConfiguration.SkinName) && !string.IsNullOrWhiteSpace(ApplicationStaticConfiguration.SkinName)) { if (ApplicationStaticConfiguration.SkinName.Equals("McSkin")) { btnClose.Image = Properties.Resources.ExitIcon_8; } else { btnClose.Image = Properties.Resources.Exit_1_16; } } switch (ApplicationStaticConfiguration.Application) { case DB_Application.AdmissionReception: case DB_Application.AllReception: case DB_Application.ClinicReception: case DB_Application.InvoiceManager: case DB_Application.QueueManager: case DB_Application.Settings: CommonViewsActions.LoadXMLFromString(layoutControl1, Resources.LocalizedRes.lyt_BasicViewContainerTitle_SaveNew); btnSaveAndClose.Text = "حفـظ وإغــلاق"; btnSaveAndNew.Text = "حفـظ وجديــد"; btnEdit.Text = "تعـديـــل"; btnDelete.Text = "حـــذف"; break; case DB_Application.PEMR: CommonViewsActions.LoadXMLFromString(layoutControl1, Resources.LocalizedRes.lyt_BasicViewContainerTitle_SaveNew_en_US); btnSaveAndClose.Text = "Save and Close"; btnSaveAndNew.Text = "Save and New"; btnEdit.Text = "Edit"; btnDelete.Text = "Delete"; break; } switch (commonTransactionType) { case DB_CommonTransactionType.CreateNew: case DB_CommonTransactionType.SaveNew: lytSaveAndClose.Visibility = LayoutVisibility.Always; lytSaveAndNew.Visibility = LayoutVisibility.Always; lytDelete.Visibility = LayoutVisibility.Never; lytEdit.Visibility = LayoutVisibility.Never; break; case DB_CommonTransactionType.UpdateExisting: lytSaveAndClose.Visibility = LayoutVisibility.Never; lytSaveAndNew.Visibility = LayoutVisibility.Never; lytDelete.Visibility = LayoutVisibility.Always; lytEdit.Visibility = LayoutVisibility.Always; break; } }
public static void ShowControl <TEditorViewer, TSearchViewer>(ref TEditorViewer editorViewerToShow, ref TSearchViewer searchViewerToShow, Control parentControlToAttach, EditorContainerType editorContainerType, ViewerName viewerName, DB_CommonTransactionType commontransactionType, string headerTitle, AbstractViewerType viewerType, bool showAsPopup, bool showInFullScreen = false, bool isSearchPanelexpanded = false) where TEditorViewer : Control, new() where TSearchViewer : Control, new() { //1--- Initialize the BaseContainer //2--- Initialize the BaseSettingsEditorContainer / BaseSearchContainer //3--- Attach the BaseSettingsEditorContainer to BaseContainer //4--- Initialize the ViewerToShow //5--- Attach the ViewerToShow to BaseSettingsEditorContainer to Top Panel //6--- If the ViewerToShow has children Viewers, then >> //7--- If Yes :: Initialize Each Child in the ViewerToShow Children //8--- Initialize The CommonTabControl //9--- Create a Tab page for each viewerToShow child //10-- Attach each Child to each suitable Tab page //11-- Attach the CommonTabControl to the BaseSettingsEditorContainer Bottom Panel //12-- Initialize the ViewerToShow MVCController //13-- Initialize the MVCController for Each Child in the ViewerToShow Children ParentControl = parentControlToAttach; ViewerName = viewerName; HeaderTitle = headerTitle; CommontransactionType = commontransactionType; if (showAsPopup) { _popupForm = new PopupBaseForm(); _popupForm.InitializePopupBaseForm(FormWindowState.Maximized, false, headerTitle, FormBorderStyle.None); CommonViewsActions.ShowUserControl(ref _baseContainer, _popupForm, true); } else { CommonViewsActions.ShowUserControl(ref _baseContainer, parentControlToAttach, true); } if (_baseContainer == null) { return; } if (!_baseContainer.IsBaseControllerInitialized) { BaseControllerObject = new BaseController <TEntity>(); _baseContainer.InitializeBaseViewerController(BaseControllerObject); } _baseContainer.InitializeBaseContainer(ViewerName, viewerType, headerTitle, false, true, true, true); if (editorViewerToShow == null || editorViewerToShow.IsDisposed) { editorViewerToShow = new TEditorViewer(); } if (searchViewerToShow == null || editorViewerToShow.IsDisposed) { searchViewerToShow = new TSearchViewer(); } _baseContainer._editorViewerToShow = editorViewerToShow; EditorViewer = (IViewer)editorViewerToShow; SearchViewer = (IViewer)searchViewerToShow; if (EditorViewer != null) { EditorViewer.ClearControls(); EditorViewer.FillControls(); } if (SearchViewer != null) { SearchViewer.ClearControls(); SearchViewer.FillControls(); } switch (viewerType) { case AbstractViewerType.EditorViewer: MVCEditorController = GenerateEditorMVCController(EditorViewer, null, editorContainerType, viewerName, viewerType); break; case AbstractViewerType.SearchViewer: MVCSearchController = GenerateEditorMVCController(SearchViewer, null, editorContainerType, viewerName, viewerType); break; } switch (viewerType) { case AbstractViewerType.EditorViewer: if (_baseEditorContainer == null) { return; } _baseEditorContainer._editorViewer = (Control)EditorViewer; _baseEditorContainer.CommonTransactionType = CommontransactionType; if (BaseControllerObject != null) { BaseControllerObject.PassMVCController(editorContainerType, viewerType); } _baseEditorContainer.InitializeBaseEditorContainer(true, false, false); break; case AbstractViewerType.SearchViewer: if (_baseSearchContainer == null) { return; } _baseSearchContainer._searchViewer = (Control)SearchViewer; if (BaseControllerObject != null) { BaseControllerObject.PassMVCController(editorContainerType, viewerType); } _baseSearchContainer.InitializeBaseSearchContainer(isSearchPanelexpanded); _baseSearchContainer.LoadGrid(); break; } if (showAsPopup && _popupForm != null) { _popupForm.Show(); } }
public static void ShowSearchControl <TSearchViewer>(ref TSearchViewer searchViewerToShow, Control parentControlToAttach, ViewerName viewerName, DB_CommonTransactionType commontransactionType, string headerTitle, bool showAsPopup, bool isSearchPanelexpanded = false) where TSearchViewer : Control, new() { ParentControl = parentControlToAttach; ViewerName = viewerName; HeaderTitle = headerTitle; CommontransactionType = commontransactionType; if (showAsPopup) { _popupForm = new PopupBaseForm(); _popupForm.InitializePopupBaseForm(FormWindowState.Maximized, false, headerTitle, FormBorderStyle.None); CommonViewsActions.ShowUserControl(ref _baseContainer, _popupForm, true); } else { CommonViewsActions.ShowUserControl(ref _baseContainer, parentControlToAttach, true); } if (_baseContainer == null) { return; } if (!_baseContainer.IsBaseControllerInitialized) { BaseControllerObject = new BaseController <TEntity>(); _baseContainer.InitializeBaseViewerController(BaseControllerObject); } _baseContainer.InitializeBaseContainer(ViewerName, AbstractViewerType.SearchViewer, headerTitle, true, false, true, true); if (searchViewerToShow == null || searchViewerToShow.IsDisposed) { searchViewerToShow = new TSearchViewer(); } SearchViewer = (IViewer)searchViewerToShow; if (SearchViewer != null) { SearchViewer.ClearControls(); SearchViewer.FillControls(); } MVCSearchController = GenerateSearchMVCController(SearchViewer, viewerName, AbstractViewerType.SearchViewer); if (_baseSearchContainer == null) { return; } _baseSearchContainer._searchViewer = (Control)SearchViewer; if (BaseControllerObject != null) { BaseControllerObject.PassMVCController(EditorContainerType.Settings, AbstractViewerType.SearchViewer); } _baseSearchContainer.InitializeBaseSearchContainer(isSearchPanelexpanded); _baseSearchContainer.LoadGrid(); if (showAsPopup && _popupForm != null) { _popupForm.Show(); } }
public static void ShowEditorControl <TEditorViewer>(ref TEditorViewer editorViewerToShow, Control parentControlToAttach, object objectToPassToViewer, IDBCommon dbObjectToLoad, EditorContainerType editorContainerType, ViewerName viewerName, DB_CommonTransactionType commontransactionType, string headerTitle, bool showAsPopup, bool showTopMost = false, bool showInFullScreen = true) where TEditorViewer : Control, new() { ParentControl = parentControlToAttach; ViewerName = viewerName; HeaderTitle = headerTitle; CommontransactionType = commontransactionType; switch (editorContainerType) { case EditorContainerType.Settings: if (showAsPopup) { _popupForm = new PopupBaseForm(); _popupForm.InitializePopupBaseForm(FormWindowState.Maximized, false, headerTitle); CommonViewsActions.ShowUserControl(ref _baseContainer, _popupForm, true); } else { CommonViewsActions.ShowUserControl(ref _baseContainer, parentControlToAttach, true); } if (_baseContainer == null) { return; } if (!_baseContainer.IsBaseControllerInitialized) { BaseControllerObject = new BaseController <TEntity>(); _baseContainer.InitializeBaseViewerController(BaseControllerObject); } _baseContainer.InitializeBaseContainer(ViewerName, AbstractViewerType.EditorViewer, headerTitle, false, true, true, true); break; case EditorContainerType.Regular: if (showAsPopup) { _popupForm = new PopupBaseForm(); if (showInFullScreen) { _popupForm.InitializePopupBaseForm(FormWindowState.Maximized, false, headerTitle, FormBorderStyle.None); } else { _popupForm.InitializePopupBaseForm(FormWindowState.Normal, false, headerTitle, FormBorderStyle.None); } CommonViewsActions.ShowUserControl(ref BasicEditorViewerContainer, _popupForm, true); } if (BasicEditorViewerContainer == null) { return; } BasicEditorViewerContainer.SetHeader(headerTitle, commontransactionType); if (!BasicEditorViewerContainer.IsBaseControllerInitialized) { BaseControllerObject = new BaseController <TEntity>(); } BasicEditorViewerContainer.InitializeBaseEditorContainer(ViewerName, HeaderTitle); BaseControllerObject.PassBaseController(BasicEditorViewerContainer); break; } if (editorViewerToShow == null || editorViewerToShow.IsDisposed) { editorViewerToShow = new TEditorViewer(); } EditorViewer = (IViewer)editorViewerToShow; if (EditorViewer != null) { if (objectToPassToViewer != null && EditorViewer is IViewerDataRelated) { ((IViewerDataRelated)EditorViewer).ViewerDataRelated = objectToPassToViewer; } EditorViewer.ClearControls(); EditorViewer.FillControls(); } MVCEditorController = GenerateEditorMVCController(EditorViewer, dbObjectToLoad, editorContainerType, viewerName, AbstractViewerType.EditorViewer); switch (editorContainerType) { case EditorContainerType.Settings: if (_baseEditorContainer == null) { return; } _baseEditorContainer._editorViewer = (Control)EditorViewer; _baseEditorContainer.CommonTransactionType = CommontransactionType; break; case EditorContainerType.Regular: BaseEditorViewerContainer <TEntity> ._editorViewer = (Control)EditorViewer; BasicEditorViewerContainer.CommonTransactionType = CommontransactionType; break; } if (BaseControllerObject != null) { BaseControllerObject.PassMVCController(editorContainerType, AbstractViewerType.EditorViewer); } switch (editorContainerType) { case EditorContainerType.Settings: _baseEditorContainer.InitializeBaseEditorContainer(true, false, false); break; case EditorContainerType.Regular: BasicEditorViewerContainer.InitializeBaseEditorContainer(); break; } if (showAsPopup && _popupForm != null) { _popupForm.Initialize((Control)EditorViewer, BasicEditorViewerContainer); _popupForm.TopMost = showTopMost; _popupForm.BringToFront(); _popupForm.ShowDialog(); } }
public override bool SaveChanges(DB_CommonTransactionType commonTransactionType) { if (ActiveCollector.ActiveDBItem == null) { return(false); } List <Person_ChartOfAccount_cu> list = null; if (Convert.ToBoolean(IsDebitChartOfAccount) || Convert.ToBoolean(IsTaxChartOfAccount) || Convert.ToBoolean(IsCurrentChartOfAccount) || Convert.ToBoolean(IsCreditChartOfAccount)) { list = new List <Person_ChartOfAccount_cu>(); } if (Convert.ToBoolean(IsDebitChartOfAccount) && Debit_ChartOfAccount != null) { Person_ChartOfAccount_cu personChart = DBCommon.CreateNewDBEntity <Person_ChartOfAccount_cu>(); personChart.ChartOfAccount_CU_ID = Convert.ToInt32(Debit_ChartOfAccount); personChart.PersonChartOfAccountType_P_ID = (int)DB_PersonChartOtAccountType.DebitAccountingCode; personChart.Person_CU_ID = Convert.ToInt32(Person_CU_ID); personChart.IsOnDuty = true; if (UserID != null) { personChart.InsertedBy = Convert.ToInt32(UserID); } switch (((IPerson_ChartOfAccount_Viewer)ActiveCollector.ActiveViewer).CommonTransactionType) { case DB_CommonTransactionType.DeleteExisting: personChart.IsOnDuty = false; break; } if (list != null) { list.Add(personChart); } } if (Convert.ToBoolean(IsCreditChartOfAccount) && Credit_ChartOfAccount != null) { Person_ChartOfAccount_cu personChart = DBCommon.CreateNewDBEntity <Person_ChartOfAccount_cu>(); personChart.ChartOfAccount_CU_ID = Convert.ToInt32(Credit_ChartOfAccount); personChart.PersonChartOfAccountType_P_ID = (int)DB_PersonChartOtAccountType.CreditAccountingCode; personChart.Person_CU_ID = Convert.ToInt32(Person_CU_ID); personChart.IsOnDuty = true; if (UserID != null) { personChart.InsertedBy = Convert.ToInt32(UserID); } switch (((IPerson_ChartOfAccount_Viewer)ActiveCollector.ActiveViewer).CommonTransactionType) { case DB_CommonTransactionType.DeleteExisting: personChart.IsOnDuty = false; break; } if (list != null) { list.Add(personChart); } } if (Convert.ToBoolean(IsCurrentChartOfAccount) && Current_ChartOfAccount != null) { Person_ChartOfAccount_cu personChart = DBCommon.CreateNewDBEntity <Person_ChartOfAccount_cu>(); personChart.ChartOfAccount_CU_ID = Convert.ToInt32(Current_ChartOfAccount); personChart.PersonChartOfAccountType_P_ID = (int)DB_PersonChartOtAccountType.CurrentAccountingCode; personChart.Person_CU_ID = Convert.ToInt32(Person_CU_ID); personChart.IsOnDuty = true; if (UserID != null) { personChart.InsertedBy = Convert.ToInt32(UserID); } switch (((IPerson_ChartOfAccount_Viewer)ActiveCollector.ActiveViewer).CommonTransactionType) { case DB_CommonTransactionType.DeleteExisting: personChart.IsOnDuty = false; break; } if (list != null) { list.Add(personChart); } } if (Convert.ToBoolean(IsTaxChartOfAccount) && Tax_ChartOfAccount != null) { Person_ChartOfAccount_cu personChart = DBCommon.CreateNewDBEntity <Person_ChartOfAccount_cu>(); personChart.ChartOfAccount_CU_ID = Convert.ToInt32(Tax_ChartOfAccount); personChart.PersonChartOfAccountType_P_ID = (int)DB_PersonChartOtAccountType.TaxAccountingCode; personChart.Person_CU_ID = Convert.ToInt32(Person_CU_ID); personChart.IsOnDuty = true; if (UserID != null) { personChart.InsertedBy = Convert.ToInt32(UserID); } switch (((IPerson_ChartOfAccount_Viewer)ActiveCollector.ActiveViewer).CommonTransactionType) { case DB_CommonTransactionType.DeleteExisting: personChart.IsOnDuty = false; break; } if (list != null) { list.Add(personChart); } } if (list != null && list.Count > 0) { foreach (Person_ChartOfAccount_cu personChartOfAccountCu in list) { personChartOfAccountCu.SaveChanges(); personChartOfAccountCu.LoadItemsList(); } } return(true); }
public virtual bool SaveChanges(DB_CommonTransactionType commonTransactionType) { return(false); }