コード例 #1
0
ファイル: TollPacker.xaml.cs プロジェクト: CrongCrong/FHSales
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            TollPackerModel tollMod = dgvTollPacker.SelectedItem as TollPackerModel;

            if (tollMod != null)
            {
                recID = tollMod.ID;
                txtTollPacker.Text   = tollMod.TollpackerName;
                txtDescription.Text  = tollMod.Description;
                btnSave.Visibility   = Visibility.Hidden;
                btnUpdate.Visibility = Visibility.Visible;
            }
        }
コード例 #2
0
        private void loadTollpackerCombo()
        {
            conDB       = new ConnectionDB();
            queryString = "SELECT ID, name, description FROM dbfh.tbltollpacker WHERE isDeleted = 0";
            TollPackerModel tollPacker = new TollPackerModel();

            MySqlDataReader reader = conDB.getSelectConnection(queryString, null);

            cmbTollpacker.Items.Clear();
            while (reader.Read())
            {
                tollPacker.ID             = reader["ID"].ToString();
                tollPacker.TollpackerName = reader["name"].ToString();
                tollPacker.Description    = reader["description"].ToString();
                cmbTollpacker.Items.Add(tollPacker);

                tollPacker = new TollPackerModel();
            }

            conDB.closeConnection();
        }
コード例 #3
0
ファイル: TollPacker.xaml.cs プロジェクト: CrongCrong/FHSales
        private List <TollPackerModel> loadDataGridDetails()
        {
            conDB       = new ConnectionDB();
            queryString = "SELECT ID, name, description FROM dbfh.tbltollpacker WHERE isDeleted = 0";
            List <TollPackerModel> lstTollpacker = new List <TollPackerModel>();
            TollPackerModel        tollPacker    = new TollPackerModel();

            MySqlDataReader reader = conDB.getSelectConnection(queryString, null);

            while (reader.Read())
            {
                tollPacker.ID             = reader["ID"].ToString();
                tollPacker.TollpackerName = reader["name"].ToString();
                tollPacker.Description    = reader["description"].ToString();

                lstTollpacker.Add(tollPacker);
                tollPacker = new TollPackerModel();
            }

            conDB.closeConnection();
            return(lstTollpacker);
        }