private void setDataSourceSanPham(String Manhomspid) { try { String mSql = String.Format("select Maspid,Masp,Tensp,Dvt,Quycach,Quydoikgl,Quydoithung,Maqrcode,Mabarcode from DM_SANPHAM order by Masp asc"); if (Manhomspid != null && Manhomspid.Length > 0) { mSql = String.Format("select Maspid,Manhomspid,Masp,Tensp,Dvt,Quycach,Quydoikgl,Quydoithung,Maqrcode,Mabarcode from DM_SANPHAM where Manhomspid ='{0}' order by Masp asc", Manhomspid); } otblSrcSanPham = MTSQLServer.getMTSQLServer().wRead(mSql, null, false); SQLAdaptor = MTSQLServer.getMTSQLServer().wAdapter(mSql, null, false); DSetMain = new DataSet(); SQLAdaptor.Fill(DSetMain, "DM_SANPHAM"); DataTable dt = DSetMain.Tables["DM_SANPHAM"]; if (otblSrcSanPham == null) { Utils.showMessage("Không thể đọc dữ liệu cần chọn...", "Thông báo"); return; } grdSanPham.DataSource = otblSrcSanPham; SysPar.SetGridReadOnly(true, gvSanPham); } catch (Exception ex) { } }
private void fRemoveUser() { if (grdNguoiDung.VisibleRowCount < 1) { Utils.showMessage("Danh sách người dùng trống", "Thông báo"); return; } string soid = grdNguoiDung.GetFocusedRowCellValue("soid").ToString(); string sql = String.Format(SQL_DELETE_ND, soid); try { int result = MTSQLServer.getMTSQLServer().wExec(sql, null, false); if (result == 1) { crud.GridForm_Loaded(); Utils.showMessage(Utils.SAVE_DB_OK, "Thông báo"); } else { Utils.showMessage(Utils.ERR_UPDATE_DB, "Thông báo"); } } catch (Exception ex) { } }
private void setDataSourceQuyenHan(String nhomQuyenID) { try { String mSql = String.Format("select nqcn.soid as soid, nqcn.macn as macn, cn.chucnang as chucnang, " + "nqcn.them as them, nqcn.xoa as xoa, nqcn.sua as sua, nqcn.duyet as duyet, nqcn.[in] as [in]" + " from HT_NHOMQUYEN_CHUCNANG nqcn left join DM_CHUCNANG cn on cn.macn = nqcn.macn" + " order by manhom asc"); if (nhomQuyenID != null && nhomQuyenID.Length > 0) { mSql = String.Format("select nqcn.soid as soid, nqcn.macn as macn, cn.chucnang as chucnang, " + "nqcn.them as them, nqcn.xoa as xoa, nqcn.sua as sua, nqcn.duyet as duyet, nqcn.[in] as [in]" + " from HT_NHOMQUYEN_CHUCNANG nqcn left join DM_CHUCNANG cn on cn.macn = nqcn.macn" + " where nqcn.manhom='{0}' order by manhom asc", nhomQuyenID); } otblSrcQuyenHan = MTSQLServer.getMTSQLServer().wRead(mSql, null, false); SQLAdaptor = MTSQLServer.getMTSQLServer().wAdapter(mSql, null, false); DSetMain = new DataSet(); SQLAdaptor.Fill(DSetMain, "HT_NHOMQUYEN_CHUCNANG"); if (otblSrcQuyenHan == null) { Utils.showMessage("Không thể đọc dữ liệu cần chọn...", "Thông báo"); return; } grdQuyenHan.DataSource = otblSrcQuyenHan; SysPar.SetGridReadOnly(true, gvQuyenHan); } catch (Exception ex) { } }
private void initComboboxNhomQuyen() { string sql = string.Format("select * from HT_NHOMQUYEN"); SQLAdaptor = MTSQLServer.getMTSQLServer().wAdapter(sql, null, false); DSetMain = new DataSet(); SQLAdaptor.Fill(DSetMain, "HT_NHOMQUYEN"); DataTable dt = DSetMain.Tables["HT_NHOMQUYEN"]; int rowNumber = dt.Rows.Count; dsNhomQuyen = new List <HT_NhomQuyen>(); if (rowNumber > 0) { for (int i = 0; i < rowNumber; i++) { string maNhom = dt.Rows[i]["manhom"].ToString(); string tenNhom = dt.Rows[i]["tennhom"].ToString(); dsNhomQuyen.Add(new HT_NhomQuyen() { manhom = maNhom, tennhom = tenNhom }); } } cbxNhomQuyen.ItemsSource = dsNhomQuyen; }
public void SaveNguoiDung() { try { SqlParameter[] arrPara = new SqlParameter[3]; arrPara[0] = new SqlParameter("@nguoidungDT", SqlDbType.Structured); arrPara[0].Value = nguoiDungDT; arrPara[1] = new SqlParameter("@nguoidung", SqlDbType.NVarChar, 50); arrPara[1].Value = MTGlobal.MT_USER_LOGIN; arrPara[2] = new SqlParameter("@maNhomQuyen", SqlDbType.NVarChar, 50); arrPara[2].Value = maNhomQuyen; int iRs = MTSQLServer.getMTSQLServer().wExec("spHT_AddNguoiDung", arrPara); if (iRs == -1) { Utils.showMessage("Dữ liệu không thể cập nhật. Vui lòng kiểm tra lại.", "Thông báo"); //return; } else { Utils.showMessage("Dữ liệu cập nhật thành công.", "Thông báo"); } } catch (Exception ex) { Utils.showMessage("Lỗi kết nối cơ sở dữ liệu", "Thông báo"); return; } }
public void SaveSanPham() { try { SqlParameter[] arrPara = new SqlParameter[4]; arrPara[0] = new SqlParameter("@tblSanPham", SqlDbType.Structured); arrPara[0].Value = sanPham; arrPara[1] = new SqlParameter("@Nhomid", SqlDbType.NVarChar, 50); arrPara[1].Value = manhomspid; arrPara[2] = new SqlParameter("@Loai", SqlDbType.NVarChar, 10); arrPara[2].Value = loai; arrPara[3] = new SqlParameter("@Nguoidung", SqlDbType.NVarChar, 50); arrPara[3].Value = MTGlobal.MT_USER_LOGIN; int iRs = MTSQLServer.getMTSQLServer().wExec("spDM_ImportSanPham", arrPara); if (iRs == -1) { Utils.showMessage("Dữ liệu không thể cập nhật. Vui lòng kiểm tra lại.", "Thông báo"); //return; } else { Utils.showMessage("Dữ liệu cập nhật thành công.", "Thông báo"); txtFile.Text = ""; initSanPhamDataTable(); grdSanPhamImport.DataSource = sanPham; } } catch (Exception ex) { Utils.showMessage("Lỗi kết nối cơ sở dữ liệu", "Lỗi"); return; } }
private bool saveNhanVien() { try { SqlParameter[] arrPara = new SqlParameter[3]; arrPara[0] = new SqlParameter("@nhanvien", SqlDbType.Structured); arrPara[0].Value = nhanVienDT; arrPara[1] = new SqlParameter("@mabophan", SqlDbType.NVarChar, 50); arrPara[1].Value = maBoPhan; arrPara[2] = new SqlParameter("@nguoidung", SqlDbType.NVarChar, 10); arrPara[2].Value = MTGlobal.MT_USER_LOGIN; int iRs = MTSQLServer.getMTSQLServer().wExec("spDM_AddNhanVien", arrPara); if (iRs == -1) { Utils.showMessage("Dữ liệu không thể cập nhật. Vui lòng kiểm tra lại.", "Thông báo"); return(false); } else { Utils.showMessage("Dữ liệu cập nhật thành công.", "Thông báo"); return(true); } } catch (Exception ex) { Utils.showMessage("Lỗi kết nối cơ sở dữ liệu", "Thông báo"); return(false); } }
private void fdoSave() { String msg = ""; try { if (MTGlobal.MT_CURRENT_ACTION == "ADD" || MTGlobal.MT_CURRENT_ACTION == "EDIT") { DataTable dt = ((DataView)gvNhomSanPham.DataSource).Table; if (MTSQLServer.getMTSQLServer().doSaveTable(SQLAdaptor, dt)) { SysPar.SetGridReadOnly(true, gvNhomSanPham); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "SAVE"); setDataSourceNhomSanPham(); msg = Utils.SAVE_DB_OK; } else { msg = Utils.ERR_UPDATE_DB; } } } catch (Exception ex) { msg = ex.Message.ToString(); } if (msg != "") { //System.Windows.MessageBox.Show(msg); Utils.showMessage(msg, "Thông báo"); } }
private void saveNhomQuyenChucNang() { try { SqlParameter[] arrPara = new SqlParameter[3]; arrPara[0] = new SqlParameter("@nhomQuyenChucNangTbl", SqlDbType.Structured); arrPara[0].Value = tblNQCN; arrPara[1] = new SqlParameter("@nguoidung", SqlDbType.NVarChar, 50); arrPara[1].Value = MTGlobal.MT_USER_LOGIN; arrPara[2] = new SqlParameter("@ketqua", SqlDbType.NVarChar, 255); arrPara[2].Direction = ParameterDirection.Output; int iRs = MTSQLServer.getMTSQLServer().wExec("spHT_AddNhomQuyenChucNang", arrPara); if (iRs == -1) { Utils.showMessage("Dữ liệu không thể cập nhật. Vui lòng kiểm tra lại.", "Thông báo"); //return; } else { Utils.showMessage("Dữ liệu cập nhật thành công.", "Thông báo"); this.Close(); } } catch (Exception ex) { Utils.showMessage("Lỗi kết nối cơ sở dữ liệu", "Thông báo"); return; } }
private void fRemoveQuyenHan() { cmdEdit.Visibility = Visibility.Hidden; cmdSave.Visibility = Visibility.Hidden; if (tblView.GetSelectedRowHandles() == null) { Utils.showMessage(Utils.SELECT_ROW_TO_DELETE, "Thông báo"); } var row = grdQuyenHan.GetRow(tblView.GetSelectedRowHandles()[0]); if (row == null) { Utils.showMessage(Utils.SELECT_ROW_TO_DELETE, "Thông báo"); } var id = ((System.Data.DataRowView)(row)).Row.ItemArray[0]; String sql = String.Format(SQL_DELETE_QH, id); try { int result = MTSQLServer.getMTSQLServer().wExec(sql, null, false); if (result == 1) { crud.GridForm_Loaded(); Utils.showMessage(Utils.SAVE_DB_OK, "Thông báo"); } else { Utils.showMessage(Utils.ERR_UPDATE_DB, "Thông báo"); } } catch (Exception ex) { } cmdEdit.Visibility = Visibility.Visible; cmdSave.Visibility = Visibility.Visible; }
private void setDataSourceBangGiaCT(String _bangGiaID) { try { String mSql = String.Format("select Banggiactid,Banggiaid,Maspid,Mavung,Masp,Tensp,Giagoc,Giasi,Giale,Ghichu from DM_BANGGIA_CHITIET order by Masp asc"); if (_bangGiaID != null && _bangGiaID.Length > 0) { mSql = String.Format("select Banggiactid,Banggiaid,Maspid,Mavung,Masp,Tensp,Giagoc,Giasi,Giale,Ghichu from DM_BANGGIA_CHITIET where Banggiaid='{0}' order by Masp asc", _bangGiaID); } otblSrcBangGiaCT = MTSQLServer.getMTSQLServer().wRead(mSql, null, false); SQLAdaptor = MTSQLServer.getMTSQLServer().wAdapter(mSql, null, false); DSetMain = new DataSet(); SQLAdaptor.Fill(DSetMain, "DM_BANGGIA_CHITIET"); if (otblSrcBangGiaCT == null) { Utils.showMessage("Không thể đọc dữ liệu cần chọn...", "Thông báo"); return; } grdBangGiaCT.DataSource = otblSrcBangGiaCT; SysPar.SetGridReadOnly(true, gvBangGiaCT); } catch (Exception ex) { } }
private void setDataSource() { try{ String mSql = ""; if (chkQR.Checked) { mSql = String.Format("select Maspid,Masp,Tensp,Dvt,Quycach,Macode=Maqrcode,cast ({0} as int) as Soluong, cast(0 as numeric(18,3)) as Dongia from DM_SANPHAM order by Masp asc", spinSoluong.Text.Trim()); } else { mSql = String.Format("select Maspid,Masp,Tensp,Dvt,Quycach,Macode=Mabarcode,cast ({0} as int) as Soluong, cast(0 as numeric(18,3)) as Dongia from DM_SANPHAM order by Masp asc", spinSoluong.Text.Trim()); } otblSrc = MTSQLServer.getMTSQLServer().wRead(mSql, null, false); if (otblSrc == null) { MessageBox.Show("Không thể đọc dữ liệu cần chọn...", "Thông báo"); return; } otblChon = otblSrc.Clone(); grdSanpham.DataSource = this.otblSrc; grdSanphamc.DataSource = this.otblChon; SysPar.SetGridReadOnly(true, gvSanpham); SysPar.SetGridReadOnly(false, gvSanphamc); //grdDSPhieuChon.Columns["Soluong"].ReadOnly = false; //grdDSPhieuChon.Columns["Soluong"].AllowFocus = true; } catch (Exception ex) { } }
private void initInfoToEdit(string id) { string sql = string.Format("select * from HT_NGUOIDUNG where soid = '{0}'", id); SQLAdaptor = MTSQLServer.getMTSQLServer().wAdapter(sql, null, false); DSetMain = new DataSet(); SQLAdaptor.Fill(DSetMain, "HT_NGUOIDUNG"); DataTable dt = DSetMain.Tables["HT_NGUOIDUNG"]; int rowNumber = dt.Rows.Count; if (rowNumber == 1) { string manv = dt.Rows[0].ItemArray[1].ToString(); string tk = dt.Rows[0].ItemArray[2].ToString(); string mk = dt.Rows[0].ItemArray[3].ToString(); oldPassword = mk; string isSync = dt.Rows[0][10].ToString(); string kyhieu = dt.Rows[0].ItemArray[11].ToString(); for (int i = 0; i < dsNhanVien.Count; i++) { if (dsNhanVien[i].Manv.ToLower() == manv.ToLower()) { cbxNhanVien.SelectedItem = dsNhanVien[i]; break; } } txtUsername.Text = tk; txtPassword.Text = mk; txtRepeatPassword.Text = mk; txtKyHieu.Text = kyhieu; if (isSync.ToLower() == "true") { chkActive.IsChecked = true; } else { chkActive.IsChecked = false; } DataTable nhomQuyenDtb = this.getNhomQuyenByIdUser(id); int size = nhomQuyenDtb.Rows.Count; if (size == 1) { string maNhom = nhomQuyenDtb.Rows[0][1].ToString(); for (int i = 0; i < dsNhomQuyen.Count; i++) { if (dsNhomQuyen[i].manhom == maNhom) { cbxNhomQuyen.SelectedItem = dsNhomQuyen[i]; break; } } } } }
private void fdoAbort() { try { MTSQLServer.getMTSQLServer().Abort(SQLAdaptor, DSetMain.Tables["DM_KHACHHANG"]); SysPar.SetGridReadOnly(true, gvKhachHang); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "ABORT"); } catch { } }
private void loadGridChucNang() { String mSql = mSql = String.Format("select nqcn.soid as soid, nqcn.macn as macn, cn.chucnang as tencn, " + "nqcn.them as them, nqcn.xoa as xoa, nqcn.sua as sua, nqcn.duyet as duyet, nqcn.[in] as [in]" + " from HT_NHOMQUYEN_CHUCNANG nqcn left join DM_CHUCNANG cn on cn.macn = nqcn.macn" + " where nqcn.manhom='{0}' order by manhom asc", nhomQuyenId); tblSelected = MTSQLServer.getMTSQLServer().wRead(mSql, null, false); grdChucNang.DataSource = tblSelected; }
private void initGridChucNang() { string sql = string.Format("select cn.* from DM_CHUCNANG cn where cn.macn not in (select nqcn.macn from HT_NHOMQUYEN_CHUCNANG nqcn where nqcn.manhom = '{0}')", this.nhomQuyenId); SQLAdaptor = MTSQLServer.getMTSQLServer().wAdapter(sql, null, false); DSetMain = new DataSet(); SQLAdaptor.Fill(DSetMain, "DM_CHUCNANG"); tblSrc = DSetMain.Tables["DM_CHUCNANG"]; grdChucNang.ItemsSource = tblSrc; }
private void fdoAbort() { try { MTSQLServer.getMTSQLServer().Abort(SQLAdaptor, DSetMain.Tables["HT_NHOMQUYEN_CHUCNANG"]); SysPar.SetGridReadOnly(true, gvQuyenHan); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "ABORT"); } catch { } }
private void fdoAbort() { try { MTSQLServer.getMTSQLServer().Abort(SQLAdaptor, DSetMain.Tables["DM_NHOMSP"]); SysPar.SetGridReadOnly(true, gvNhomSanPham); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "ABORT"); } catch { } }
private void fdoAbort() { try { MTSQLServer.getMTSQLServer().Abort(SQLAdaptor, DSetMain.Tables["DM_BANGGIA_CHITIET"]); SysPar.SetGridReadOnly(true, gvBangGiaCT); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "ABORT"); } catch { } }
private void fdoAbort() { DisableEditCode(); try { MTSQLServer.getMTSQLServer().Abort(SQLAdaptor, DSetMain.Tables["DM_SANPHAM"]); SysPar.SetGridReadOnly(true, gvSanPham); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "ABORT"); } catch { } }
private void fdoAbort() { try { currentUserId = ""; MTSQLServer.getMTSQLServer().Abort(SQLAdaptor, DSetMain.Tables["HT_NGUOIDUNG"]); SysPar.SetGridReadOnly(true, gvNguoiDung); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "ABORT"); } catch { } }
private DataTable getNhomQuyenByIdUser(string idUser) { string sql = string.Format("select nq.* from HT_NHOMQUYEN nq left join HT_QUYENHAN qh on nq.soid = qh.soid_nhomquyen where qh.soid_nguoidung = '{0}'", id); SQLAdaptor = MTSQLServer.getMTSQLServer().wAdapter(sql, null, false); DSetMain = new DataSet(); SQLAdaptor.Fill(DSetMain, "HT_NHOMQUYEN"); DataTable dt = DSetMain.Tables["HT_NHOMQUYEN"]; return(dt); }
private DataTable getProductByCode(string code) { string mSQL = "select * from DM_SANPHAM"; if (code.Length > 0) { mSQL += string.Format(" where UPPER(Masp) = '{0}' ", code.ToString().ToUpper()); } DataTable dt = MTSQLServer.getMTSQLServer().wRead(mSQL, null, false); return(dt); }
private void loadTaiKhoanToLookupEdit() { String mSql = String.Format("select * from DM_TAIKHOAN order by Matk asc"); otblTK = MTSQLServer.getMTSQLServer().wRead(mSql, null, false); repositoryItemTKNo.DataSource = otblTK; repositoryItemTKNo.ValueMember = "Matk"; repositoryItemTKNo.DisplayMember = "Matk"; repositoryItemTKNo.NullText = ""; colTKNo.ColumnEdit = repositoryItemTKNo; colTKCo.ColumnEdit = repositoryItemTKNo; }
private void fdoSave() { String msg = ""; try { if (MTGlobal.MT_CURRENT_ACTION == "ADD" || MTGlobal.MT_CURRENT_ACTION == "EDIT") { DataTable dt = ((DataView)gvQuyenHan.DataSource).Table; DataTable tblNQCN = convertTableSelectedToTableNQCN(dt); try { SqlParameter[] arrPara = new SqlParameter[3]; arrPara[0] = new SqlParameter("@nhomQuyenChucNangTbl", SqlDbType.Structured); arrPara[0].Value = tblNQCN; arrPara[1] = new SqlParameter("@nguoidung", SqlDbType.NVarChar, 50); arrPara[1].Value = MTGlobal.MT_USER_LOGIN; arrPara[2] = new SqlParameter("@ketqua", SqlDbType.NVarChar, 255); arrPara[2].Direction = ParameterDirection.Output; int iRs = MTSQLServer.getMTSQLServer().wExec("spHT_AddNhomQuyenChucNang", arrPara); if (iRs == -1) { Utils.showMessage("Dữ liệu không thể cập nhật. Vui lòng kiểm tra lại.", "Thông báo"); //return; } else { Utils.showMessage("Dữ liệu cập nhật thành công.", "Thông báo"); this.Close(); } } catch (Exception ex) { Utils.showMessage("Lỗi kết nối cơ sở dữ liệu", "Thông báo"); return; } } } catch (Exception ex) { msg = ex.Message.ToString(); } if (msg != "") { //System.Windows.MessageBox.Show(msg); Utils.showMessage(msg, "Thông báo"); } }
private List <FunctionNode> initParents() { string sql = string.Format("select cn.* from DM_CHUCNANG cn " + "where (cn.macn not in (select nqcn.macn " + "from HT_NHOMQUYEN_CHUCNANG nqcn " + "where nqcn.manhom = '{0}') " + "or cn.macn in (select distinct a.macnroot " + "from DM_CHUCNANG a " + "where a.macnroot is not null " + "and a.macn not in (select nqcn.macn " + "from HT_NHOMQUYEN_CHUCNANG nqcn " + " where nqcn.manhom = '{0}'))) " + "and macnroot is null", this.nhomQuyenId); if (removeFunctionIds != "") { sql = string.Format("select cn.* from DM_CHUCNANG cn " + "where (cn.macn not in (select nqcn.macn " + "from HT_NHOMQUYEN_CHUCNANG nqcn " + "where nqcn.manhom = '{0}') " + "or cn.macn in (select distinct a.macnroot " + "from DM_CHUCNANG a " + "where a.macnroot is not null " + "and a.macn not in (select nqcn.macn " + "from HT_NHOMQUYEN_CHUCNANG nqcn " + " where nqcn.manhom = '{0}'))) " + "or cn.macn in ({1}) and macnroot is null", this.nhomQuyenId, removeFunctionIds); //sql = string.Format("select cn.* from DM_CHUCNANG cn where cn.macn not in (select nqcn.macn from HT_NHOMQUYEN_CHUCNANG nqcn where nqcn.manhom = '{0}') or cn.macn in ({1}) and macnroot is null", this.nhomQuyenId, removeFunctionIds); } SQLAdaptor = MTSQLServer.getMTSQLServer().wAdapter(sql, null, false); DSetMain = new DataSet(); SQLAdaptor.Fill(DSetMain, "DM_CHUCNANG"); DataTable dt = DSetMain.Tables["DM_CHUCNANG"]; List <FunctionNode> parents = new List <FunctionNode>(); foreach (DataRow rw in dt.Rows) { FunctionNode parent = new FunctionNode(); parent.macn = rw["macn"].ToString(); parent.chucnang = rw["chucnang"].ToString(); parents.Add(parent); } return(parents); }
private void setDataSourceNhomQuyen() { try { String mSql = String.Format("select * from HT_NHOMQUYEN order by manhom"); otblSrcNhomQuyen = MTSQLServer.getMTSQLServer().wRead(mSql, null, false); if (otblSrcNhomQuyen == null) { Utils.showMessage("Không thể đọc dữ liệu cần chọn...", "Thông báo"); return; } grdNhomQuyen.DataSource = otblSrcNhomQuyen; SysPar.SetGridReadOnly(true, gvNhomQuyen); } catch (Exception ex) { } }
private void setDataSourceNhomSanPham() { try { String mSql = String.Format("select Manhomspid,Manhom,Tennhom from DM_NHOMSP order by Manhom asc"); otblSrcNhomSanPham = MTSQLServer.getMTSQLServer().wRead(mSql, null, false); if (otblSrcNhomSanPham == null) { Utils.showMessage("Không thể đọc dữ liệu cần chọn...", "Thông báo"); return; } grdNhomSanPham.DataSource = otblSrcNhomSanPham; SysPar.SetGridReadOnly(true, gvNhomSanPham); } catch (Exception ex) { } }
private void setDataSourceBangGia() { try { String mSql = String.Format("select Banggiaid,Banggia,Tungay,Denngay,Ngayapdung,Apdung from DM_BANGGIA order by Banggiaid asc"); otblSrcBangGia = MTSQLServer.getMTSQLServer().wRead(mSql, null, false); if (otblSrcBangGia == null) { Utils.showMessage("Không thể đọc dữ liệu cần chọn...", "Thông báo"); return; } grdBangGia.DataSource = otblSrcBangGia; SysPar.SetGridReadOnly(true, gvBangGia); } catch (Exception ex) { } }
private DataRow getChucNangByCode(string macn) { if (macn == "") { return(null); } string sql = string.Format("select cn.* from DM_CHUCNANG cn where cn.macn ='{0}'", macn); SQLAdaptor = MTSQLServer.getMTSQLServer().wAdapter(sql, null, false); DSetMain = new DataSet(); SQLAdaptor.Fill(DSetMain, "DM_CHUCNANG"); DataTable dt = DSetMain.Tables["DM_CHUCNANG"]; if (dt.Rows.Count < 0) { return(null); } return(dt.Rows[0]); }