Esempio n. 1
0
 /// <summary>
 /// Gets the data.
 /// </summary>
 /// <returns></returns>
 public Dlv005DataSet GetData()
 {
     Dlv005DataSet = new Dlv005DataSet();
     Dlv005DataSet.Initialize(Dlv005DataSet);
     Dlv005DataSet.AcceptChanges();
     return(Dlv005DataSet);
 }
        /// <summary>
        /// Updates a commision.
        /// </summary>
        /// <param name="position">The position.</param>
        public void UpdateCommision(DataRow dataUpdateRow)
        {
            InputModel inputModel = new InputModel
            {
                DL31_KOMM_ANFORDERUNG_NR    = dataUpdateRow["DL31_KOMM_ANFORDERUNG_NR"].ToString(),
                DL31_KOMM__STATUS_ID        = Convert.ToDecimal(dataUpdateRow["DL31_KOMM__STATUS_ID"]),
                DL31_ERPROBUNGSINHALT       = dataUpdateRow["DL31_ERPROBUNGSINHALT"].ToString(),
                DL31_START_DATUM            = Convert.ToDateTime(dataUpdateRow["DL31_START_DATUM"]),
                DL31_ENDE_DATUM             = Convert.ToDateTime(dataUpdateRow["DL31_ENDE_DATUM"]),
                DL31_KOMM_ERPROBUNGSORT_ID  = Convert.ToDecimal(dataUpdateRow["DL31_KOMM_ERPROBUNGSORT_ID"]),
                DL31_KOMM_STRECKENART_ID    = Convert.ToDecimal(dataUpdateRow["DL31_KOMM_STRECKENART_ID"]),
                DL31_KOMM_ERPROBUNGSART_ID  = Convert.ToDecimal(dataUpdateRow["DL31_KOMM_ERPROBUNGSART_ID"]),
                DL31_BAUREIHEN              = dataUpdateRow["DL31_BAUREIHEN"].ToString(),
                DL31_AUFTRAGGEBER_OE        = Convert.ToDecimal(dataUpdateRow["DL31_AUFTRAGGEBER_OE"]),
                DL31_AUFTRAGGEBER_PERSID    = Convert.ToDecimal(dataUpdateRow["DL31_AUFTRAGGEBER_PERSID"]),
                DL31_FAHRTENLEITER_PERSID   = Convert.ToDecimal(dataUpdateRow["DL31_FAHRTENLEITER_PERSID"]),
                DL31_ENGINEERING_AST_PERSID = Convert.ToDecimal(dataUpdateRow["DL31_ENGINEERING_AST_PERSID"]),
                DL31_FAHRBERECHTIGUNG_ID    = Convert.ToDecimal(dataUpdateRow["DL31_FAHRBERECHTIGUNG_ID"]),
                DL31_HV_QUALIFIKATION_ID    = Convert.ToDecimal(dataUpdateRow["DL31_HV_QUALIFIKATION_ID"]),
                DL31_SONDERQUALIFIKATION_ID = Convert.ToDecimal(dataUpdateRow["DL31_SONDERQUALIFIKATION_ID"]),
                DL31_SAMSTAGSARBEIT         = dataUpdateRow["DL31_SAMSTAGSARBEIT"].ToString(),
                DL31_SONNTAGSARBEIT         = dataUpdateRow["DL31_SONNTAGSARBEIT"].ToString(),
                DL31_KOMM_ANFORDERUNG_ID    = Convert.ToDecimal(dataUpdateRow["DL31_KOMM_ANFORDERUNG_ID"]),
            };

            Dlv005DataSet.Update(inputModel);

            AllocationInputModel allocationInputModel = new AllocationInputModel();

            var dl31ForeingKeyId = Convert.ToDecimal(inputModel.DL31_KOMM_ANFORDERUNG_ID);

            foreach (Dlv005DataSet.AllocationGridTableRow row in Dlv005DataSet.AllocationGridTable)
            {
                var dl32ForeignKeyId = Convert.ToDecimal(row.DL32_EXT_KOMM_ANFORDERUNG_ID);
                var dl32PrimaryKey   = Convert.ToDecimal(row.DL32_KOMM_ANFORDERUNG_KONTO_ID);

                if (dl32ForeignKeyId == dl31ForeingKeyId && dl32PrimaryKey > 0)
                {
                    allocationInputModel.DL32_KONTIERUNG                = row.IsDL32_KONTIERUNGNull() ? string.Empty : row.DL32_KONTIERUNG;
                    allocationInputModel.DL32_ANTEIL_PROZENT            = row.IsDL32_ANTEIL_PROZENTNull() ? null : row.DL32_ANTEIL_PROZENT as decimal?;
                    allocationInputModel.DL32_KOMM_ANFORDERUNG_KONTO_ID = row.IsDL32_KOMM_ANFORDERUNG_KONTO_IDNull() ? null : row.DL32_KOMM_ANFORDERUNG_KONTO_ID as decimal?;

                    Dlv005DataSet.UpdateDl32(allocationInputModel);
                }
                else if (dl32ForeignKeyId == dl31ForeingKeyId && dl32PrimaryKey < 0)
                {
                    allocationInputModel.DL32_KONTIERUNG              = row.IsDL32_KONTIERUNGNull() ? string.Empty : row.DL32_KONTIERUNG;
                    allocationInputModel.DL32_ANTEIL_PROZENT          = row.IsDL32_ANTEIL_PROZENTNull() ? null : row.DL32_ANTEIL_PROZENT as decimal?;
                    allocationInputModel.DL32_EXT_KOMM_ANFORDERUNG_ID = row.IsDL32_EXT_KOMM_ANFORDERUNG_IDNull() ? null : row.DL32_EXT_KOMM_ANFORDERUNG_ID as decimal?;

                    Dlv005DataSet.InsertDl32(allocationInputModel);
                }
            }
            confirmIsNewCopy = false;
            auxID            = 0;
            ReloadAllocation();
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes the specified data model.
        /// </summary>
        /// <param name="dataModel">The data model.</param>
        public void Initialize(Dlv005DataSet dataModel)
        {
            Dlv005DataAccessComponent dataAccessComponent = new Dlv005DataAccessComponent();

            dataAccessComponent.GetOverviewData(dataModel.MainTable);
            dataAccessComponent.GetDL38Data(dataModel.DL38Table);
            dataAccessComponent.GetDL39Data(dataModel.DL39Table);
            dataAccessComponent.GetDL40Data(dataModel.DL40Table);
            dataAccessComponent.GetSD111Data(dataModel.SD111Table);
            dataAccessComponent.GetBD09Data(dataModel.BD09Table);
            dataAccessComponent.GetBD06Data(dataModel.BD06Table);
            dataAccessComponent.GetAllocationGridData(dataModel.AllocationGridTable);
        }
Esempio n. 4
0
        public void InitializeAllocationTable(Dlv005DataSet dataModel)
        {
            Dlv005DataAccessComponent dataAccessComponent = new Dlv005DataAccessComponent();

            dataAccessComponent.GetAllocationGridData(dataModel.AllocationGridTable);
        }
Esempio n. 5
0
        public void InitializeMainTable(Dlv005DataSet dataModel)
        {
            Dlv005DataAccessComponent dataAccessComponent = new Dlv005DataAccessComponent();

            dataAccessComponent.GetOverviewData(dataModel.MainTable);
        }
Esempio n. 6
0
 public void DeleteDataDl32OnlyAllocation(decimal deleteID)
 {
     Dlv005DataSet.DeleteOnlyAllocation(deleteID);
 }
Esempio n. 7
0
 /// <summary>
 /// Reloads this instance.
 /// </summary>
 public void Reload()
 {
     Dlv005DataSet.Clear();
     Dlv005DataSet.Initialize(Dlv005DataSet);
     Dlv005DataSet.AcceptChanges();
 }
Esempio n. 8
0
 /// <summary>
 /// Reloads the overview.
 /// </summary>
 public void ReloadOverview()
 {
     Dlv005DataSet.MainTable.Clear();
     Dlv005DataSet.InitializeMainTable(Dlv005DataSet);
     Dlv005DataSet.AcceptChanges();
 }
Esempio n. 9
0
 public void ReloadAllocation()
 {
     Dlv005DataSet.AllocationGridTable.Clear();
     Dlv005DataSet.InitializeAllocationTable(Dlv005DataSet);
     Dlv005DataSet.AcceptChanges();
 }
Esempio n. 10
0
 /// <summary>
 /// Deletes this instance.
 /// </summary>
 public void DeleteData(decimal deleteID)
 {
     Dlv005DataSet.Delete(deleteID);
 }
Esempio n. 11
0
 /// <summary>
 /// Cancels the save operation and may perform some rollback operations.
 /// </summary>
 public void CancelSave()
 {
     Dlv005DataSet.RejectChanges();
 }
Esempio n. 12
0
        /// <summary>
        /// Saves the specific data in DB.
        /// </summary
        public void SaveCommision(DataRow dataRowForInsertNewCommision)
        {
            InputModel inputModel = new InputModel();

            inputModel.DL31_KOMM_ANFORDERUNG_NR    = dataRowForInsertNewCommision["DL31_KOMM_ANFORDERUNG_NR"].ToString();
            inputModel.DL31_ERPROBUNGSINHALT       = dataRowForInsertNewCommision["DL31_ERPROBUNGSINHALT"].ToString();
            inputModel.DL31_START_DATUM            = Convert.ToDateTime(dataRowForInsertNewCommision["DL31_START_DATUM"]);
            inputModel.DL31_ENDE_DATUM             = Convert.ToDateTime(dataRowForInsertNewCommision["DL31_ENDE_DATUM"]);
            inputModel.DL31_BAUREIHEN              = dataRowForInsertNewCommision["DL31_BAUREIHEN"].ToString();
            inputModel.DL31_AUFTRAGGEBER_PERSID    = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_AUFTRAGGEBER_PERSID"]);
            inputModel.DL31_KOMM_ERPROBUNGSORT_ID  = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_KOMM_ERPROBUNGSORT_ID"]);
            inputModel.DL31_KOMM_STRECKENART_ID    = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_KOMM_STRECKENART_ID"]);
            inputModel.DL31_KOMM_ERPROBUNGSART_ID  = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_KOMM_ERPROBUNGSART_ID"]);
            inputModel.DL31_AUFTRAGGEBER_OE        = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_AUFTRAGGEBER_OE"]);
            inputModel.DL31_FAHRTENLEITER_PERSID   = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_FAHRTENLEITER_PERSID"]);
            inputModel.DL31_ENGINEERING_AST_PERSID = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_ENGINEERING_AST_PERSID"]);
            inputModel.DL31_HV_QUALIFIKATION_ID    = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_HV_QUALIFIKATION_ID"]);
            inputModel.DL31_SONDERQUALIFIKATION_ID = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_SONDERQUALIFIKATION_ID"]);
            inputModel.DL31_FAHRBERECHTIGUNG_ID    = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_FAHRBERECHTIGUNG_ID"]);
            inputModel.DL31_KOMM__STATUS_ID        = Convert.ToDecimal(dataRowForInsertNewCommision["DL31_KOMM__STATUS_ID"]);
            inputModel.DL31_SAMSTAGSARBEIT         = dataRowForInsertNewCommision["DL31_SAMSTAGSARBEIT"].ToString();
            inputModel.DL31_SONNTAGSARBEIT         = dataRowForInsertNewCommision["DL31_SONNTAGSARBEIT"].ToString();

            Dlv005DataSet.Insert(inputModel);
            ReloadOverview();

            DataRow lastRow = Dlv005DataSet.MainTable.Rows[Dlv005DataSet.MainTable.Rows.Count - 1];

            allocationGridInsertPosition = Convert.ToDecimal(lastRow["DL31_KOMM_ANFORDERUNG_ID"]);

            AllocationInputModel allocationInputModel = new AllocationInputModel();

            if (confirmIsNewCopy)
            {
                foreach (Dlv005DataSet.AllocationGridTableRow row in Dlv005DataSet.AllocationGridTable)
                {
                    var rowValue = Convert.ToDecimal(row.DL32_EXT_KOMM_ANFORDERUNG_ID);
                    if (rowValue == auxID)
                    {
                        allocationInputModel.DL32_KONTIERUNG              = row.IsDL32_KONTIERUNGNull() ? string.Empty : row.DL32_KONTIERUNG;
                        allocationInputModel.DL32_ANTEIL_PROZENT          = row.IsDL32_ANTEIL_PROZENTNull() ? string.Empty : row.DL32_ANTEIL_PROZENT;
                        allocationInputModel.DL32_EXT_KOMM_ANFORDERUNG_ID = allocationGridInsertPosition;

                        Dlv005DataSet.InsertDl32(allocationInputModel);
                    }
                }
            }

            foreach (Dlv005DataSet.AllocationGridTableRow row in Dlv005DataSet.AllocationGridTable)
            {
                var rowValue = Convert.ToDecimal(row.DL32_EXT_KOMM_ANFORDERUNG_ID);
                if (rowValue < 0)
                {
                    allocationInputModel.DL32_KONTIERUNG              = row.IsDL32_KONTIERUNGNull() ? string.Empty : row.DL32_KONTIERUNG;
                    allocationInputModel.DL32_ANTEIL_PROZENT          = row.IsDL32_ANTEIL_PROZENTNull() ? string.Empty : row.DL32_ANTEIL_PROZENT;
                    allocationInputModel.DL32_EXT_KOMM_ANFORDERUNG_ID = allocationGridInsertPosition;

                    Dlv005DataSet.InsertDl32(allocationInputModel);
                }
            }
            confirmIsNewCopy = false;
            auxID            = 0;
        }