Exemple #1
0
        public int DeleteFixtureWithRelation(BMS_DAL.DS.BMSDS ds)
        {
            int r = 0;

            if (ds.TInvoiceDetails.GetChanges() != null)
            {
                using (BMS_DAL.DS.BMSDSTableAdapters.TInvoiceDetailsTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TInvoiceDetailsTableAdapter())
                {
                    r += ta.UpdateWithTrans(ds.TInvoiceDetails);
                }
            }
            if (ds.TInvoices.GetChanges() != null)
            {
                using (BMS_DAL.DS.BMSDSTableAdapters.TInvoicesTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TInvoicesTableAdapter())
                {
                    r += ta.UpdateWithTrans(ds.TInvoices);
                }
            }
            if (ds.TFixtures.GetChanges() != null)
            {
                using (BMS_DAL.DS.BMSDSTableAdapters.TFixturesTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TFixturesTableAdapter())
                {
                    r += ta.UpdateWithTrans(ds.TFixtures);
                }
            }

            return(r);
        }
Exemple #2
0
        public int UpdateFixture(BMS_DAL.DS.BMSDS.TFixturesDataTable dt)
        {
            int r = 0;

            if (dt.GetChanges() != null)
            {
                using (BMS_DAL.DS.BMSDSTableAdapters.TFixturesTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TFixturesTableAdapter())
                {
                    r = ta.UpdateWithTrans(dt);
                }
            }
            return(r);
        }
Exemple #3
0
        public int UpdateFixtureWithRelation(BMS_DAL.DS.BMSDS ds)
        {
            int r = 0;

            var dschanges = ds.GetChanges();

            using (BMS_DAL.DS.BMSDSTableAdapters.TFixturesTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TFixturesTableAdapter())
            {
                r += ta.UpdateWithTrans((BMS_DAL.DS.BMSDS.TFixturesDataTable)dschanges.Tables["TFixtures"]);
            }
            foreach (DataRow idrow in dschanges.Tables["TInvoices"].AsEnumerable().Where(t => t.RowState.Equals(DataRowState.Unchanged)))
            {
                if ((int)idrow["ID"] < 0)
                {
                    idrow.SetAdded();
                }
                else
                {
                    idrow.SetModified();
                }
            }
            using (BMS_DAL.DS.BMSDSTableAdapters.TInvoicesTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TInvoicesTableAdapter())
            {
                r += ta.UpdateWithTrans((BMS_DAL.DS.BMSDS.TInvoicesDataTable)dschanges.Tables["TInvoices"]);
            }
            foreach (DataRow idrow in dschanges.Tables["TInvoiceDetails"].AsEnumerable().Where(t => t.RowState.Equals(DataRowState.Unchanged)))
            {
                if ((int)idrow["ID"] < 0)
                {
                    idrow.SetAdded();
                }
                else
                {
                    idrow.SetModified();
                }
            }
            using (BMS_DAL.DS.BMSDSTableAdapters.TInvoiceDetailsTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TInvoiceDetailsTableAdapter())
            {
                r += ta.UpdateWithTrans((BMS_DAL.DS.BMSDS.TInvoiceDetailsDataTable)dschanges.Tables["TInvoiceDetails"]);
            }

            return(r);
        }