Example #1
0
        private void LoadZone()
        {
            ZoneBL objBl = new ZoneBL();
            var    dt    = objBl.Select();

            txtZone.DataSource    = dt;
            txtZone.DisplayMember = "ZoneName";
            txtZone.ValueMember   = "ZoneID";
        }
        private void LoadZoneID()
        {
            ZoneBL objZone = new ZoneBL();
            var    dt      = objZone.Select();

            txtZoneID.DataSource         = dt;
            txtZoneID.AutoCompleteMode   = AutoCompleteMode.Suggest;
            txtZoneID.AutoCompleteSource = AutoCompleteSource.ListItems;
            txtZoneID.DisplayMember      = "ZoneName";
            txtZoneID.ValueMember        = "ZoneID";
        }
        private void LoadRoute()
        {
            ZoneBL obj = new ZoneBL();
            var    dt  = obj.Select();

            txtRoute.DataSource         = dt;
            txtRoute.AutoCompleteMode   = AutoCompleteMode.Suggest;
            txtRoute.AutoCompleteSource = AutoCompleteSource.ListItems;
            txtRoute.DisplayMember      = "ZoneName";
            txtRoute.ValueMember        = "ZoneId";
            txtRoute.Text = "---Select---";
        }
Example #4
0
        private void loadData()
        {
            ZoneBL          objzone = new ZoneBL();
            List <tbl_Zone> dt      = objzone.Select();

            dgvZone.Columns.Clear();
            if (dt != null && dt.Count > 0)
            {
                DataGridViewImageColumn edit = new DataGridViewImageColumn();
                edit.Image       = Properties.Resources.edit;
                edit.ImageLayout = DataGridViewImageCellLayout.Zoom;
                edit.HeaderText  = "Edit";
                DataGridViewImageColumn delete = new DataGridViewImageColumn();
                delete.Image       = Properties.Resources.delete;
                delete.ImageLayout = DataGridViewImageCellLayout.Zoom;
                delete.HeaderText  = "Delete";
                edit.Width         = delete.Width = 20;
                dgvZone.Columns.Add(edit);
                dgvZone.Columns.Add(delete);
                dgvZone.DataSource          = dt;
                dgvZone.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            }
        }