public AddNewVendorFrm(UniEnums.VendorType vendorType)
 {
     InitializeComponent();
     _vendor = new VendorDetail() { VendorType = vendorType.ToString(), ProcessedDate = DateTime.Now.Date };
     _isNewRecord = true;
     _vendorType = vendorType;
 }
        public VendorDetailsFrm(UniEnums.VendorType vendorType)
        {
            InitializeComponent();

            _vendorType = vendorType;
            _reportForm = new ReportForm<VendorDetail>(bindingNavigator1, dataGridView1,
                                                      bindingNavigatorPositionItem.TextBox, lblReportStatus);
        }
        public AddNewVendorFrm(long srNo, UniEnums.VendorType vendorType)
        {
            InitializeComponent();

            _vendorType = vendorType;
            _vendor = _uniDb.VendorDetails.Single(x => x.SrNo == srNo
                                                       && x.VendorType == vendorType.ToString());
            _isNewRecord = false;
        }
        private IQueryable<VendorDetail> GetFiterQuery()
        {
            if (_vendorType != UniEnums.VendorType.VisitingCard)
                _vendorType = (UniEnums.VendorType)Enum.Parse(typeof(UniEnums.VendorType), cbType.Text);

            return _reportForm.UniDb.VendorDetails
                              .Where(x => x.VendorType == _vendorType.ToString()
                                          && x.CompanyName.Contains(txtCompanyName.Text)
                                          && x.ContactPerson.Contains(txtContactPerson.Text)
                                          && x.MobileNo.Contains(txtMobileNo.Text)
                                          && x.BusinessType.Contains(cmbBusinessType.Text)
                                          && x.Sector.Contains(cmbSector.Text)
                                          && x.Expert.Contains(cmbExpert.Text)
                                          && x.OfficeAddress.Contains(txtLocation.Text)
                                          && (!cbNetworking.Checked || x.Networking == cbNetworking.Checked)
                                          && !x.IsDeleted
                                          && (!cbSearchByDate.Checked
                                              || (x.ProcessedDate.Date >= dtpDateFrom.Value.Date
                                                  && x.ProcessedDate.Date <= dtpDateTo.Value.Date)));
        }