Ejemplo n.º 1
0
        private void CreateMastHist()
        {
            IACDataSetTableAdapters.ACCOUNTTableAdapter  ACCOUNTTableAdapter  = new IACDataSetTableAdapters.ACCOUNTTableAdapter();
            IACDataSetTableAdapters.MASTERTableAdapter   MASTERTableAdapter   = new IACDataSetTableAdapters.MASTERTableAdapter();
            IACDataSetTableAdapters.MASTHISTTableAdapter MASTHISTTableAdapter = new IACDataSetTableAdapters.MASTHISTTableAdapter();
            BindingSource MASTHISTBindingSource = new BindingSource();

            MASTHISTBindingSource.DataSource = AddOniacDataSet.MASTHIST;

            Object loMasterKey = ACCOUNTTableAdapter.AccountNumber("OS_LOANS"), loMasterHistSeq = null;
            String lsMasterKey = (String)loMasterKey;
            Int32  lnSeq       = 0;

            MASTERTableAdapter.Fill(AddOniacDataSet.MASTER, lsMasterKey);
            if (AddOniacDataSet.MASTER.Rows.Count != 0)
            {
                if (AddOniacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_OLOAN") != 0)
                {
                    MASTHISTBindingSource.AddNew();
                    MASTHISTBindingSource.EndEdit();
                    AddOniacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_ACC_NO", AddOniacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"));
                    AddOniacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <DateTime>("MASTHIST_POST_DATE", AddOniacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    loMasterHistSeq = MASTHISTTableAdapter.SeqNoQuery(AddOniacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"), AddOniacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    if (loMasterHistSeq != null)
                    {
                        lnSeq = (int)loMasterHistSeq + 1;
                    }
                    else
                    {
                        lnSeq = 1;
                    }
                    AddOniacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Int32>("MASTHIST_SEQ_NO", lnSeq);
                    AddOniacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_NAME", AddOniacDataSet.MASTER.Rows[0].Field <String>("MASTER_NAME"));
                    AddOniacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_CUR_OLOAN", AddOniacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_OLOAN"));
                    AddOniacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_YTD_OLOAN", AddOniacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_OLOAN"));
                    AddOniacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_YTD_NOTES", AddOniacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_NOTES"));
                    AddOniacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_IAC_TYPE", "O");
                    MASTHISTBindingSource.EndEdit();
                    MASTHISTTableAdapter.Update(AddOniacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position]);
                    AddOniacDataSet.MASTHIST.AcceptChanges();
                }
            }
        }
Ejemplo n.º 2
0
        private void PostOloans()
        {
            IACDataSetTableAdapters.ACCOUNTTableAdapter ACCOUNTTableAdapter = new IACDataSetTableAdapters.ACCOUNTTableAdapter();
            IACDataSetTableAdapters.MASTERTableAdapter  MASTERTableAdapter  = new IACDataSetTableAdapters.MASTERTableAdapter();
            BindingSource MASTERBindingSource = new BindingSource();
            Object        loMasterKey         = null;
            String        lsMasterKey         = "";

            MASTERBindingSource.DataSource = AddOniacDataSet.MASTER;


            loMasterKey = ACCOUNTTableAdapter.AccountNumber("OS_LOANS");
            lsMasterKey = (String)loMasterKey;

            MASTERTableAdapter.Fill(AddOniacDataSet.MASTER, lsMasterKey);

            if (AddOniacDataSet.MASTER.Rows.Count != 0)
            {
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_RSV", 0);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_CONT", 0);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_OLOAN", 0);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_ADJ", 0);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_BAD", 0);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_LOSS", 0);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_INT", 0);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_NOTES", 0);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_OLOAN", 0);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_NOTES", 0);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_INT", 0);

                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_OLOAN", lnMASTER_OS_LOANS);
                AddOniacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_YTD_OLOAN", AddOniacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_OLOAN") + lnMASTER_OS_LOANS);
                AddOniacDataSet.MASTER.Rows[0].SetField <DateTime>("MASTER_POST_DATE", DateTime.Now.Date);
                MASTERBindingSource.EndEdit();
                MASTERTableAdapter.Update(AddOniacDataSet.MASTER.Rows[0]);
                AddOniacDataSet.MASTER.AcceptChanges();
            }
        }
Ejemplo n.º 3
0
        public void CreateMastHist()
        {
            IACDataSetTableAdapters.ACCOUNTTableAdapter  ACCOUNTTableAdapter  = new IACDataSetTableAdapters.ACCOUNTTableAdapter();
            IACDataSetTableAdapters.MASTERTableAdapter   MASTERTableAdapter   = new IACDataSetTableAdapters.MASTERTableAdapter();
            IACDataSetTableAdapters.MASTHISTTableAdapter MASTHISTTableAdapter = new IACDataSetTableAdapters.MASTHISTTableAdapter();
            BindingSource MASTHISTBindingSource = new BindingSource();

            MASTHISTBindingSource.DataSource = ContingiacDataSet.MASTHIST;

            Object loMasterKey = ACCOUNTTableAdapter.AccountNumber("OS_LOANS"), loMasterHistSeq = null;
            String lsMasterKey = (String)loMasterKey;
            Int32  lnSeq       = 0;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);
            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                if (ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_OLOAN") != 0 || ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_NOTES") != 0)
                {
                    MASTHISTBindingSource.AddNew();
                    MASTHISTBindingSource.EndEdit();
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_ACC_NO", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <DateTime>("MASTHIST_POST_DATE", ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    loMasterHistSeq = MASTHISTTableAdapter.SeqNoQuery(ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"), ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    if (loMasterHistSeq != null)
                    {
                        lnSeq = (int)loMasterHistSeq + 1;
                    }
                    else
                    {
                        lnSeq = 1;
                    }
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Int32>("MASTHIST_SEQ_NO", lnSeq);
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_NAME", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_NAME"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_CUR_OLOAN", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_OLOAN"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_YTD_OLOAN", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_OLOAN"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_CUR_NOTES", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_NOTES"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_YTD_NOTES", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_NOTES"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_IAC_TYPE", "C");
                    MASTHISTBindingSource.EndEdit();
                    MASTHISTTableAdapter.Update(ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position]);
                    ContingiacDataSet.MASTHIST.AcceptChanges();
                }
            }

            loMasterKey     = ACCOUNTTableAdapter.AccountNumber("CONTING");
            loMasterHistSeq = null;
            lsMasterKey     = (String)loMasterKey;
            lnSeq           = 0;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);
            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                if (ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_CONT") != 0)
                {
                    MASTHISTBindingSource.AddNew();
                    MASTHISTBindingSource.EndEdit();
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_ACC_NO", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <DateTime>("MASTHIST_POST_DATE", ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    loMasterHistSeq = MASTHISTTableAdapter.SeqNoQuery(ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"), ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    if (loMasterHistSeq != null)
                    {
                        lnSeq = (int)loMasterHistSeq + 1;
                    }
                    else
                    {
                        lnSeq = 1;
                    }
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Int32>("MASTHIST_SEQ_NO", lnSeq);
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_NAME", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_NAME"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_CUR_CONT", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_CONT"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_YTD_CONT", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_CONT"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_IAC_TYPE", "C");
                    MASTHISTBindingSource.EndEdit();
                    MASTHISTTableAdapter.Update(ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position]);
                    ContingiacDataSet.MASTHIST.AcceptChanges();
                }
            }
            loMasterKey     = ACCOUNTTableAdapter.AccountNumber("ADJUST");
            loMasterHistSeq = null;
            lsMasterKey     = (String)loMasterKey;
            lnSeq           = 0;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);
            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                if (ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_ADJ") != 0)
                {
                    MASTHISTBindingSource.AddNew();
                    MASTHISTBindingSource.EndEdit();
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_ACC_NO", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <DateTime>("MASTHIST_POST_DATE", ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    loMasterHistSeq = MASTHISTTableAdapter.SeqNoQuery(ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"), ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    if (loMasterHistSeq != null)
                    {
                        lnSeq = (int)loMasterHistSeq + 1;
                    }
                    else
                    {
                        lnSeq = 1;
                    }
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Int32>("MASTHIST_SEQ_NO", lnSeq);
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_NAME", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_NAME"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_CUR_ADJ", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_ADJ"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_YTD_ADJ", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_ADJ"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_IAC_TYPE", "C");
                    MASTHISTBindingSource.EndEdit();
                    MASTHISTTableAdapter.Update(ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position]);
                    ContingiacDataSet.MASTHIST.AcceptChanges();
                }
            }

            loMasterKey     = ACCOUNTTableAdapter.AccountNumber("LOSS_RES");
            loMasterHistSeq = null;
            lsMasterKey     = (String)loMasterKey;
            lnSeq           = 0;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);
            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                if (ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_LOSS") != 0)
                {
                    MASTHISTBindingSource.AddNew();
                    MASTHISTBindingSource.EndEdit();
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_ACC_NO", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <DateTime>("MASTHIST_POST_DATE", ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    loMasterHistSeq = MASTHISTTableAdapter.SeqNoQuery(ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"), ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    if (loMasterHistSeq != null)
                    {
                        lnSeq = (int)loMasterHistSeq + 1;
                    }
                    else
                    {
                        lnSeq = 1;
                    }
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Int32>("MASTHIST_SEQ_NO", lnSeq);
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_NAME", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_NAME"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_CUR_LOSS", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_LOSS"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_YTD_LOSS", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_LOSS"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_IAC_TYPE", "C");
                    MASTHISTBindingSource.EndEdit();
                    MASTHISTTableAdapter.Update(ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position]);
                    ContingiacDataSet.MASTHIST.AcceptChanges();
                }
            }

            loMasterKey     = ACCOUNTTableAdapter.AccountNumber("RES_LOSS");
            loMasterHistSeq = null;
            lsMasterKey     = (String)loMasterKey;
            lnSeq           = 0;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);
            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                if (ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_RSV") != 0)
                {
                    MASTHISTBindingSource.AddNew();
                    MASTHISTBindingSource.EndEdit();
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_ACC_NO", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <DateTime>("MASTHIST_POST_DATE", ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    loMasterHistSeq = MASTHISTTableAdapter.SeqNoQuery(ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"), ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    if (loMasterHistSeq != null)
                    {
                        lnSeq = (int)loMasterHistSeq + 1;
                    }
                    else
                    {
                        lnSeq = 1;
                    }
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Int32>("MASTHIST_SEQ_NO", lnSeq);
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_NAME", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_NAME"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_CUR_RSV", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_RSV"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_YTD_RSV", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_RSV"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_IAC_TYPE", "C");
                    MASTHISTBindingSource.EndEdit();
                    MASTHISTTableAdapter.Update(ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position]);
                    ContingiacDataSet.MASTHIST.AcceptChanges();
                }
            }

            loMasterKey     = ACCOUNTTableAdapter.AccountNumber("BAD_DEBTS");
            loMasterHistSeq = null;
            lsMasterKey     = (String)loMasterKey;
            lnSeq           = 0;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);
            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                if (ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_BAD") != 0)
                {
                    MASTHISTBindingSource.AddNew();
                    MASTHISTBindingSource.EndEdit();
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_ACC_NO", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <DateTime>("MASTHIST_POST_DATE", ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    loMasterHistSeq = MASTHISTTableAdapter.SeqNoQuery(ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"), ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    if (loMasterHistSeq != null)
                    {
                        lnSeq = (int)loMasterHistSeq + 1;
                    }
                    else
                    {
                        lnSeq = 1;
                    }
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Int32>("MASTHIST_SEQ_NO", lnSeq);
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_NAME", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_NAME"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_CUR_BAD", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_CUR_BAD"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_YTD_BAD", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_BAD"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_IAC_TYPE", "C");
                    MASTHISTBindingSource.EndEdit();
                    MASTHISTTableAdapter.Update(ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position]);
                    ContingiacDataSet.MASTHIST.AcceptChanges();
                }
            }

            loMasterKey     = ACCOUNTTableAdapter.AccountNumber("AMORT_INT");
            loMasterHistSeq = null;
            lsMasterKey     = (String)loMasterKey;
            lnSeq           = 0;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);
            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                if (ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_AMORT_CUR_INT") != 0)
                {
                    MASTHISTBindingSource.AddNew();
                    MASTHISTBindingSource.EndEdit();
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_ACC_NO", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <DateTime>("MASTHIST_POST_DATE", ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    loMasterHistSeq = MASTHISTTableAdapter.SeqNoQuery(ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_ACC_NO"), ContingiacDataSet.MASTER.Rows[0].Field <DateTime>("MASTER_POST_DATE"));
                    if (loMasterHistSeq != null)
                    {
                        lnSeq = (int)loMasterHistSeq + 1;
                    }
                    else
                    {
                        lnSeq = 1;
                    }
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Int32>("MASTHIST_SEQ_NO", lnSeq);
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_NAME", ContingiacDataSet.MASTER.Rows[0].Field <String>("MASTER_NAME"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_AMORT_CUR_INT", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_AMORT_CUR_INT"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <Decimal>("MASTHIST_AMORT_YTD_INT", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_AMORT_YTD_INT"));
                    ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position].SetField <String>("MASTHIST_IAC_TYPE", "C");
                    MASTHISTBindingSource.EndEdit();
                    MASTHISTTableAdapter.Update(ContingiacDataSet.MASTHIST.Rows[MASTHISTBindingSource.Position]);
                    ContingiacDataSet.MASTHIST.AcceptChanges();
                }
            }
        }
Ejemplo n.º 4
0
        private void UpdateMaster()
        {
            IACDataSetTableAdapters.ACCOUNTTableAdapter ACCOUNTTableAdapter = new IACDataSetTableAdapters.ACCOUNTTableAdapter();
            IACDataSetTableAdapters.MASTERTableAdapter  MASTERTableAdapter  = new IACDataSetTableAdapters.MASTERTableAdapter();
            BindingSource MASTERBindingSource = new BindingSource();

            MASTERBindingSource.DataSource = ContingiacDataSet.MASTER;

            Object loMasterKey = ACCOUNTTableAdapter.AccountNumber("BAD_DEBTS");
            String lsMasterKey = (String)loMasterKey;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);

            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_RSV", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_CONT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_ADJ", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_BAD", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_LOSS", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_INT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_INT", 0);

                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_BAD", lnMASTER_BAD);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_YTD_BAD", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_BAD") + lnMASTER_BAD);
                ContingiacDataSet.MASTER.Rows[0].SetField <DateTime>("MASTER_POST_DATE", DateTime.Now.Date);
                MASTERBindingSource.EndEdit();
                MASTERTableAdapter.Update(ContingiacDataSet.MASTER.Rows[0]);
                ContingiacDataSet.MASTER.AcceptChanges();
            }

            loMasterKey = ACCOUNTTableAdapter.AccountNumber("RES_LOSS");
            lsMasterKey = (String)loMasterKey;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);

            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_RSV", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_CONT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_ADJ", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_BAD", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_LOSS", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_INT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_INT", 0);

                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_RSV", lnMASTER_RSV);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_YTD_RSV", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_RSV") + lnMASTER_RSV);
                ContingiacDataSet.MASTER.Rows[0].SetField <DateTime>("MASTER_POST_DATE", DateTime.Now.Date);
                MASTERBindingSource.EndEdit();
                MASTERTableAdapter.Update(ContingiacDataSet.MASTER.Rows[0]);
                ContingiacDataSet.MASTER.AcceptChanges();
            }

            loMasterKey = ACCOUNTTableAdapter.AccountNumber("LOSS_RES");
            lsMasterKey = (String)loMasterKey;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);

            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_RSV", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_CONT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_ADJ", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_BAD", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_LOSS", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_INT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_INT", 0);

                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_LOSS", lnMASTER_LOSS);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_YTD_LOSS", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_LOSS") + lnMASTER_LOSS);
                ContingiacDataSet.MASTER.Rows[0].SetField <DateTime>("MASTER_POST_DATE", DateTime.Now.Date);
                MASTERBindingSource.EndEdit();
                MASTERTableAdapter.Update(ContingiacDataSet.MASTER.Rows[0]);
                ContingiacDataSet.MASTER.AcceptChanges();
            }

            loMasterKey = ACCOUNTTableAdapter.AccountNumber("ADJUST");
            lsMasterKey = (String)loMasterKey;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);

            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_RSV", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_CONT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_ADJ", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_BAD", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_LOSS", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_INT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_INT", 0);

                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_ADJ", lnMASTER_ADJ);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_YTD_ADJ", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_ADJ") + lnMASTER_ADJ);
                ContingiacDataSet.MASTER.Rows[0].SetField <DateTime>("MASTER_POST_DATE", DateTime.Now.Date);
                MASTERBindingSource.EndEdit();
                MASTERTableAdapter.Update(ContingiacDataSet.MASTER.Rows[0]);
                ContingiacDataSet.MASTER.AcceptChanges();
            }

            loMasterKey = ACCOUNTTableAdapter.AccountNumber("CONTING");
            lsMasterKey = (String)loMasterKey;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);

            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_RSV", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_CONT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_ADJ", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_BAD", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_LOSS", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_INT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_INT", 0);

                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_CONT", lnMASTER_CONT);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_YTD_CONT", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_CONT") + lnMASTER_CONT);
                ContingiacDataSet.MASTER.Rows[0].SetField <DateTime>("MASTER_POST_DATE", DateTime.Now.Date);
                MASTERBindingSource.EndEdit();
                MASTERTableAdapter.Update(ContingiacDataSet.MASTER.Rows[0]);
                ContingiacDataSet.MASTER.AcceptChanges();
            }

            loMasterKey = ACCOUNTTableAdapter.AccountNumber("OS_LOANS");
            lsMasterKey = (String)loMasterKey;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);

            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_RSV", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_CONT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_ADJ", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_BAD", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_LOSS", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_INT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_INT", 0);

                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_NOTES", lnMASTER_NOTES);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_YTD_NOTES", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_NOTES") + lnMASTER_NOTES);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_OLOAN", lnMASTER_OS_LOANS);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_YTD_OLOAN", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_YTD_OLOAN") + lnMASTER_OS_LOANS);
                ContingiacDataSet.MASTER.Rows[0].SetField <DateTime>("MASTER_POST_DATE", DateTime.Now.Date);
                MASTERBindingSource.EndEdit();
                MASTERTableAdapter.Update(ContingiacDataSet.MASTER.Rows[0]);
                ContingiacDataSet.MASTER.AcceptChanges();
            }

            loMasterKey = ACCOUNTTableAdapter.AccountNumber("AMORT_INT");
            lsMasterKey = (String)loMasterKey;

            MASTERTableAdapter.Fill(ContingiacDataSet.MASTER, lsMasterKey);

            if (ContingiacDataSet.MASTER.Rows.Count != 0)
            {
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_RSV", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_CONT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_ADJ", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_BAD", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_LOSS", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_INT", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_OLOAN", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_NOTES", 0);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_INT", 0);

                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_CUR_INT", lnMASTER_AMORT_INT);
                ContingiacDataSet.MASTER.Rows[0].SetField <Decimal>("MASTER_AMORT_YTD_INT", ContingiacDataSet.MASTER.Rows[0].Field <Decimal>("MASTER_AMORT_YTD_INT") + lnMASTER_AMORT_INT);
                ContingiacDataSet.MASTER.Rows[0].SetField <DateTime>("MASTER_POST_DATE", DateTime.Now.Date);
                MASTERBindingSource.EndEdit();
                MASTERTableAdapter.Update(ContingiacDataSet.MASTER.Rows[0]);
                ContingiacDataSet.MASTER.AcceptChanges();
            }
        }