Ejemplo n.º 1
0
 public BMS_DAL.DS.BMSDS GetFixtureWithRelation()
 {
     BMS_DAL.DS.BMSDS ds = new BMS_DAL.DS.BMSDS();
     using (BMS_DAL.DS.BMSDSTableAdapters.TFixturesTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TFixturesTableAdapter())
     {
         try
         {
             ds.TFixtures.Merge(ta.GetData());
         }
         catch (Exception ex) { throw ex; }
     }
     using (BMS_DAL.DS.BMSDSTableAdapters.TInvoicesTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TInvoicesTableAdapter())
     {
         try
         {
             ds.TInvoices.Merge(ta.GetData());
         }
         catch (Exception ex) { throw ex; }
     }
     using (BMS_DAL.DS.BMSDSTableAdapters.TInvoiceDetailsTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TInvoiceDetailsTableAdapter())
     {
         try
         {
             ds.TInvoiceDetails.Merge(ta.GetData());
         }
         catch (Exception ex) { throw ex; }
     }
     return(ds);
 }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            _daService = null;
            _bmsDS = null;
            _instance = null;
        }
Ejemplo n.º 4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            _daService = new BMS_Service.DAService();
            _bmsDS = new BMS_DAL.DS.BMSDS();

            this.AttachEvent();
        }
Ejemplo n.º 5
0
 void toolStripButton_Print_Click(object sender, EventArgs e)
 {
     BMS_DAL.DS.BMSDS ds = new BMS_DAL.DS.BMSDS();
     ds.Merge(new DataRow[] { FixDataRow });
     ds.Merge(new DataRow[] { DataRowItem });
     ds.Merge(DataRowItem.GetTInvoiceDetailsRows());
     ds.Merge(new DataRow[] { ((BMS_DAL.DS.BMSDS)InvoiceDetailDV.Table.DataSet).TVessels.FindByID(FixDataRow.VSL_ID) });
     RPT.XtraReport1 xr = new RPT.XtraReport1(ds, DataRowItem.ID);
     xr.ShowPreviewDialog();
 }
Ejemplo n.º 6
0
        public int UpdateDS(BMS_DAL.DS.BMSDS ds)
        {
            int r = 0;

            if (ds.GetChanges() != null)
            {
                using (BMS_DAL.DS.BMSDSTableAdapters.TInvoicesTableAdapter ta = new BMS_DAL.DS.BMSDSTableAdapters.TInvoicesTableAdapter())
                {
                    r = ta.Update(ds);
                }
            }
            return(r);
        }
Ejemplo n.º 7
0
        public XtraReport1(BMS_DAL.DS.BMSDS ds, int invoiceid)
        {
            InitializeComponent();

            this.bmsds1.Merge(ds);

            INVOICE_ID.Visible = false;
            INVOICE_ID.Value   = invoiceid;

            List <DevExpress.XtraReports.Parameters.ParameterInfo> parainfoL = new List <DevExpress.XtraReports.Parameters.ParameterInfo>();

            parainfoL.Add(new DevExpress.XtraReports.Parameters.ParameterInfo(INVOICE_ID, new System.Windows.Forms.Control()));
            this.RaiseParametersRequestSubmit(parainfoL, true);
        }
Ejemplo n.º 8
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);
        }