private void Find_Vendor(object sender, EventArgs e)
 {
     using (VendorListForm frm = new VendorListForm())
     {
         frm.ShowDialog();
         if (frm.vendorSelected != null)
         {
             //_view.vendorName = frm.vendorSelected.VendorName;
             Filter(null, null);
         }
     }
 }
        private void Find_Vendor(object sender, EventArgs e)
        {
            using (VendorListForm frm = new VendorListForm())
            {
                frm.VendorNumber = _view.headSeleted.VendorCode;
                frm.ShowDialog();
                if (frm.vendorSelected != null)
                {
                    POReceiptHeaderModel rcv = _view.headSeleted;
                    rcv.VendorId   = frm.vendorSelected.VendorId;
                    rcv.VendorCode = frm.vendorSelected.VendorNumber;
                    rcv.VendorName = frm.vendorSelected.VendorName;

                    _view.headSeleted = rcv;
                }
            }
        }
Esempio n. 3
0
        public override void Run()
        {
            VendorListForm    form = new VendorListForm();
            IVendorRepository dao  = new NHibernateVendorRepository();

            form.VendorsList += delegate { form.Vendors = dao.FindActive(); };
            form.VendorAdd   += delegate { new AddVendor().Run(); };
            form.VendorEdit  += delegate(object sender, VendorEventArgs e) {
                new EditVendor(e.Vendor).Run();
            };
            form.VendorDelete += delegate(object sender, VendorEventArgs e) {
                dao.Delete(e.Vendor);
            };
            form.VendorMakeInactive += delegate(object sender, VendorEventArgs e) {
                dao.MakeInactive(e.Vendor);
            };
            WorkbenchSingleton.AddChild(form);
        }
 private void Set_Vendor(object sender, EventArgs e)
 {
     using (VendorListForm frm = new VendorListForm())
     {
         frm.ShowDialog();
         if (frm.vendorSelected != null)
         {
             //_view.vendorNum = frm.vendorSelected.VendorNumber;
             MetroGrid grd = sender as MetroGrid;
             if (grd.SelectedRows.Count > 0)
             {
                 DialogResult dialogResult = MessageBox.Show("Are you sure to set this vendor.", "Please confirm.", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                 if (dialogResult == DialogResult.Yes)
                 {
                     foreach (DataGridViewRow dgr in grd.SelectedRows)
                     {
                         //RequisitionLineModel curr = (RequisitionLineModel)_view.bindingLine.Current;
                         RequisitionLineModel curr = (RequisitionLineModel)dgr.DataBoundItem;
                         try
                         {
                             if (!curr.RejectFlag)
                             {
                                 curr.VendorId   = frm.vendorSelected.VendorId;
                                 curr.VendorName = frm.vendorSelected.VendorName;
                                 _repository.UpdatePRLine(curr);
                             }
                         }
                         catch
                         {
                         }
                     }
                     //_view.RefreshLinesGird();
                     Filter(null, null);
                 }
             }
         }
     }
 }