Пример #1
0
 private void cmbTinh_EditValueChanged(object sender, EventArgs e)
 {
     if (cmbTinh.EditValue != DBNull.Value)
     {
         QLMamNon.Dao.QLMamNonDs.QuanHuyenDataTable table = StaticDataFacade.Get(StaticDataKeys.QuanHuyen) as QLMamNon.Dao.QLMamNonDs.QuanHuyenDataTable;
         this.quanHuyenRowBindingSource.DataSource = table.Select(String.Format("ThanhPhoId={0}", cmbTinh.EditValue));
     }
 }
Пример #2
0
        public static string GetQuanHuyenById(QLMamNon.Dao.QLMamNonDs.QuanHuyenDataTable table, Int32 id)
        {
            if (id < 0)
            {
                return(CommonConstant.EMPTY);
            }

            DataRow[] rows = table.Select(String.Format("QuanHuyenId={0}", id));
            if (rows != null && rows.Length > 0)
            {
                return(rows[0]["Name"] as String);
            }

            return(CommonConstant.EMPTY);
        }