Ejemplo n.º 1
0
        private void offerVersionGroupDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            OfferVersionGroup offervg = offerVersionGroupBindingSource.Current as OfferVersionGroup;

            using (Form2 form = new Form2(offervg, SOE))
            {
                form.ShowDialog();
            }
        }
Ejemplo n.º 2
0
        public Form2(OfferVersionGroup obj, SalesOfferEntities SOE)
        {
            InitializeComponent();
            //SOEOI = new SalesOfferEntities();
            this.SOEOI = SOE;


            IList <OfferItem> oi = new System.ComponentModel.BindingList <OfferItem>();

            oi = SOE.OfferItem.Local.ToBindingList();
            // offerItemBindingSource = new BindingSource();
            offerItemBindingSource.DataSource = oi.Where(offi => offi.OfferVersionGroupId == obj.Id).ToList();


            offerBindingSource.DataSource = obj.OfferVersion.Offer;

            offerVersionBindingSource = new BindingSource();

            var qovid = ((from ov in SOEOI.OfferVersion
                          where ov.OfferId == obj.OfferVersion.OfferId
                          select ov.IssueDate)).SingleOrDefault();

            DateTime ovid;

            if (DateTime.TryParse(qovid.ToString(), out ovid))
            {
                labIssueDate.Text = ovid.ToString("yyyy/MM/dd");
            }
            else
            {
                labIssueDate.Text = null;
            }



            //offerVersionBindingSource.DataSource = SOEOI.OfferVersion.Local.ToBindingList().Where(ov => ov.OfferId == obj.OfferVersion.OfferId);
        }