private void BindForm()
        {
            #region Events
            dgvJewel.EditingControlShowing += CostingGridEditingControlShowing;
            dgvJewel.CellEndEdit           += OnCostingFormatCellEndEdit;
            dgvJewel.CellValidating        += OnCostingFormatCellValidating;
            dgvJewel.CellEnter             += OnCostingFormatCellEnter;
            #endregion

            btnSave.Enabled = false;

            cboParty.DataSource   = _supplierService.GetActiveSuppliers();
            cboType.DataSource    = _iconfigurationService.LooseDiamondType();
            dtLooseDiamonds.Value = DateTime.Now;

            QueryableItems = _looseDiamondService.GetLooseDiamonds();
            ConfigDataGridView(dgvJewel);

            var diamondInfo = _looseDiamondService.GetLooseDiamonds().FirstOrDefault();

            if (diamondInfo == null)
            {
                return;
            }

            if (QueryableItems != null)
            {
                BindValues(CurrentItem.Entity);
            }
        }
        private DataSet GetLooseDiamondReport()
        {
            var looseDiamondDataSet   = new LooseDiamondDataSet();
            var looseDiamondDataTable = looseDiamondDataSet.Tables["LooseDiamonds"];

            var firmDataTable = looseDiamondDataSet.Tables["FirmMaster"];

            firmDataTable = _firmDataService.GetFirmDataTable(firmDataTable);
            var abd = cboCustomer.SelectedItem;

            //var looseDiamondList = _looseDiamondService.GetLooseDiamonds()
            //                           .Where(ld => ld.CustomerId == ((Customer)(cboCustomer.SelectedItem)).CustomersId
            //                           && ld.DiamondDate.Date >= fromDateTimePicker.Value.Date && ld.DiamondDate.Date <= toDateTimePicker.Value.Date).ToList();


            var looseDiamondList = _looseDiamondService.GetLooseDiamonds();

            if (looseDiamondList.Count == 0)
            {
                MessageBox.Show("No Data found!");
                return(null);
            }

            int counter = 1;

            foreach (var diamond in looseDiamondList)
            {
                var diamondRow = looseDiamondDataTable.NewRow();

                diamondRow["SrNo"]          = counter;
                diamondRow["DiamondCode"]   = diamond.DiamondCode;
                diamondRow["Customer"]      = _customerService.GetCustomerByCode(diamond.DiamondCode).ContactName;
                diamondRow["SieveSize"]     = diamond.SieveSize;
                diamondRow["DiamondWeight"] = diamond.DiamondWeight;
                diamondRow["Quality"]       = diamond.Quality;
                diamondRow["VVS"]           = diamond.VVS;
                diamondRow["Amount"]        = diamond.Amount;

                looseDiamondDataTable.Rows.Add(diamondRow);

                counter = counter + 1;
            }

            return(looseDiamondDataSet);
        }