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 fdoAdd() { try { int mMM = int.Parse(Convert.ToDateTime(pDenNgay).Month.ToString().PadLeft(2, '0')); int mYY = int.Parse(Convert.ToDateTime(pDenNgay).Year.ToString()); pPhieuID = MTGlobal.GetNewID(); txtSophieu.Text = MTGlobal.GetSophieu(MTGlobal.MT_KYHIEU_CUAHANG, pLoaiPhieu, mMM, mYY, MTGlobal.MT_USER_LOGIN).ToString(); dtpNgaylap.Text = DateTime.Now.ToShortDateString(); dtpNgayPS.Text = DateTime.Now.ToShortDateString(); BindData(); if (SysPar.SetGridReadOnly(false, gvPhieu)) { gvPhieu.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom; gvPhieu.FocusedRowHandle = GridControl.NewItemRowHandle; gvPhieu.FocusedColumn = gvPhieu.Columns[0]; gvPhieu.ShowEditor(); } setReadOnly(false); MTGlobal.SetToolStripButtonAction(pACT_ROLE, MTButton, "ADD"); txtSophieu.Focus(); isEdit = true; } catch (Exception ex) { Utils.showMessage(ex.Message.ToString(), "Thông báo lỗi"); } }
private void frmMain_Load(object sender, EventArgs e) { SysPar.SetFormatGridControl(grdSanpham, gvSanpham); SysPar.SetFormatGridControl(grdSanphamc, gvSanphamc); setDataSource(); try { spinSoluong.Text = SysPar.MT_BARCODE_COPYNO.ToString(); if (SysPar.MT_DEFAULT_TYPE == "QR") { chkQR.Checked = true; } else { chkQR.Checked = false; } if (SysPar.MT_DEFAUL_TEM_ROW == 3) { cbMautem.SelectedIndex = 0; } else { cbMautem.SelectedIndex = 1; } } catch { } }
public TC_PhieuThuFrm(String mPhieuTCID, String mLoaiPhieu, String mTuNgay, String mDenNgay, MTGlobal.MT_ROLE mActRole, bool isAddNew = false) { InitializeComponent(); this.pPhieuTCID = mPhieuTCID; this.pTuNgay = mTuNgay == "" ? DateTime.Now.ToShortDateString() : mTuNgay; this.pDenNgay = mDenNgay == "" ? DateTime.Now.ToShortDateString() : mDenNgay; this.pLoaiPhieu = mLoaiPhieu; this.pACT_ROLE = mActRole; lblTitle.Text = mLoaiPhieu == MTGlobal.PT ? "Phiếu thu - " + MTGlobal.RPT_COMPANY : "Phiếu chi - " + MTGlobal.RPT_COMPANY; lblTitleText.Text = mLoaiPhieu == MTGlobal.PT ? "Phiếu thu" : "Phiếu chi"; Dlg = Utils.shwWait(); setUserRight(); loadCustomerToLookupEdit(); loadLydoToLookupEdit(); loadNhanVienToLookupEdit(); loadTaiKhoanToLookupEdit(); if (isAddNew) { fdoAdd(); } else { BindData(); SysPar.SetGridReadOnly(true, gvPhieuThuCT); setReadOnly(true); } Utils.closeWait(Dlg); }
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) { } }
public NX_PhieuXuat(String mPhieuNXID, String mLoaiPhieu, String mTuNgay, String mDenNgay, MTGlobal.MT_ROLE mActRole, bool isAddNew = false) { InitializeComponent(); this.lblTitle.Text = "Phiếu xuất kho - " + MTGlobal.RPT_COMPANY; this.pPhieuNXID = mPhieuNXID; this.pTuNgay = mTuNgay == "" ? DateTime.Now.ToShortDateString() : mTuNgay; this.pDenNgay = mDenNgay == "" ? DateTime.Now.ToShortDateString() : mDenNgay; this.pLoaiPhieu = mLoaiPhieu; this.pACT_ROLE = mActRole; Dlg = Utils.shwWait(); setUserRight(); loadWarehourseToLookupEdit(); loadCustomerToLookupEdit(); loadLydoToLookupEdit(); if (isAddNew) { fdoAdd(); } else { BindData(); SysPar.SetGridReadOnly(true, gvPhieuXuat); setReadOnly(true); } System.Threading.Thread oThreSP = new System.Threading.Thread(LoadSanPham); oThreSP.Start(); Utils.closeWait(Dlg); }
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 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 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) { } }
public CX_PhieuCX(String mPhieuID, String mLoaiPhieu, String mTuNgay, String mDenNgay, MTGlobal.MT_ROLE mActRole, bool isAddNew = false) { InitializeComponent(); this.pPhieuID = mPhieuID; this.pTuNgay = mTuNgay == "" ? DateTime.Now.ToShortDateString() : mTuNgay; this.pDenNgay = mDenNgay == "" ? DateTime.Now.ToShortDateString() : mDenNgay; this.pLoaiPhieu = mLoaiPhieu; this.pACT_ROLE = mActRole; Dlg = Utils.shwWait(); setUserRight(); loadCustomerToLookupEdit(); loadCarToLookupEdit(); if (isAddNew) { fdoAdd(); } else { BindData(); SysPar.SetGridReadOnly(true, gvPhieu); setReadOnly(true); } System.Threading.Thread oThreSP = new System.Threading.Thread(LoadSanPham); oThreSP.Start(); Utils.closeWait(Dlg); }
private void BindData(bool isDetailOnly = false) { try { if (isDetailOnly) { otblCXCT = new MTSQLServer().wRead(String.Format("SELECT A.*,B.Tensp,B.Dvt,B.Quycach FROM NX_CHANHXECT A LEFT JOIN DM_SANPHAM B ON A.Masp=B.Masp WHERE Chanhxeid='{0}' ORDER BY Chanhxectid ASC", pPhieuID), null, false); grdPhieu.DataSource = otblCXCT; SysPar.SetGridReadOnly(false, gvPhieu); } else { txtTrongluong.Text = ""; txtChiphi.Text = ""; cbThanhtoan.Text = ""; txtMadv.Text = ""; txtTendonvi.Text = ""; txtDienthoai.Text = ""; txtDiachi.Text = ""; txtSoxe.Text = ""; txtLoaixe.Text = ""; txtTaixe.Text = ""; txtDienthoaiXe.Text = ""; txtGhichu.Text = ""; if (pPhieuID != "") { String mSql = String.Format("SELECT * FROM NX_CHANHXE WHERE Chanhxeid='{0}'", pPhieuID); otblCX = new MTSQLServer().wRead(mSql, null, false); if (otblCX != null) { foreach (DataRow vR in otblCX.Rows) { txtSophieu.Text = vR["Sophieu"].ToString(); dtpNgaylap.EditValue = vR["Ngayct"].ToString() != "" ? Convert.ToDateTime(vR["Ngayct"].ToString()).ToShortDateString() : ""; dtpNgayPS.EditValue = vR["Ngayps"].ToString() != "" ? Convert.ToDateTime(vR["Ngayps"].ToString()).ToShortDateString() : ""; txtTrongluong.Text = vR["Trongluong"].ToString(); txtChiphi.Text = vR["Chiphi"].ToString(); cbThanhtoan.Text = vR["HTThanhtoan"].ToString(); txtMadv.Text = vR["Makh"].ToString(); txtTendonvi.Text = vR["Tenkh"].ToString(); txtDienthoai.Text = vR["Dienthoai"].ToString(); txtDiachi.Text = vR["Diachi"].ToString(); txtSoxe.Text = vR["Soxe"].ToString(); txtLoaixe.Text = vR["Loaixe"].ToString(); txtTaixe.Text = vR["Taixe"].ToString(); txtDienthoaiXe.Text = vR["Dienthoaixe"].ToString(); txtGhichu.Text = vR["Ghichu"].ToString(); } } } otblCXCT = new MTSQLServer().wRead(String.Format("SELECT A.*,B.Tensp,B.Dvt,B.Quycach FROM NX_CHANHXECT A LEFT JOIN DM_SANPHAM B ON A.Masp=B.Masp WHERE Chanhxeid='{0}' ORDER BY Chanhxectid ASC", pPhieuID), null, false); grdPhieu.DataSource = otblCXCT; SysPar.SetGridReadOnly(false, gvPhieu); } } catch { } }
private void fdoEdit() { if (SysPar.SetGridReadOnly(false, gvTichLuy)) { gvTichLuy.Focus(); gvTichLuy.FocusedColumn = colMasp; gvTichLuy.ShowEditor(); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "EDIT"); } }
private void fdoEdit() { if (SysPar.SetGridReadOnly(false, gvNguoiDung)) { gvNguoiDung.Focus(); gvNguoiDung.FocusedColumn = colmanv; gvNguoiDung.ShowEditor(); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "EDIT"); } }
private void fdoEdit() { if (SysPar.SetGridReadOnly(false, gvBangGia)) { gvBangGia.Focus(); gvBangGia.FocusedColumn = colBanggia; gvBangGia.ShowEditor(); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "EDIT"); } }
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() { try { MTSQLServer.getMTSQLServer().Abort(SQLAdaptor, DSetMain.Tables["DM_KHACHHANG"]); SysPar.SetGridReadOnly(true, gvKhachHang); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "ABORT"); } catch { } }
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 fdoEdit() { if (SysPar.SetGridReadOnly(false, gvQuyenHan)) { gvQuyenHan.Focus(); gvQuyenHan.FocusedColumn = colthem; gvQuyenHan.ShowEditor(); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "EDIT"); } }
private void fdoAbort() { try { MTSQLServer.getMTSQLServer().Abort(SQLAdaptor, DSetMain.Tables["DM_NHOMSP"]); SysPar.SetGridReadOnly(true, gvNhomSanPham); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "ABORT"); } catch { } }
private void fdoEdit() { if (SysPar.SetGridReadOnly(false, gvNhomSanPham)) { gvNhomSanPham.Focus(); gvNhomSanPham.FocusedColumn = colManhom; gvNhomSanPham.ShowEditor(); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "EDIT"); } }
private void BindDataCT(String mPhieuID) { try { String mSql = String.Format("SELECT A.*,B.Tensp,B.Dvt,B.Quycach FROM NX_CHANHXECT A LEFT JOIN DM_SANPHAM B ON A.Masp=B.Masp WHERE Chanhxeid='{0}' order by Chanhxectid asc", mPhieuID); DataTable oTblNXCT = new MTSQLServer().wRead(mSql, null, false); grdPhieuCT.DataSource = oTblNXCT; SysPar.SetGridReadOnly(true, gvPhieuCT); } catch { } }
private void BindDataCT(String mPhieuID) { try { String mSql = String.Format("SELECT * FROM BH_PHIEUBHCT where Phieubhid='{0}' AND ISNULL(Quatang,0)=0 order by Phieubhctid ASC", mPhieuID); DataTable oTblNXCT = new MTSQLServer().wRead(mSql, null, false); grdPhieuCT.DataSource = oTblNXCT; SysPar.SetGridReadOnly(true, gvPhieuCT); } catch { } }
private void BindDataCT(String mPhieuID) { try { String mSql = String.Format("SELECT * FROM NX_PHIEUNXCT where phieunxid='{0}' ORDER BY Phieunxctid asc", mPhieuID); DataTable oTblNXCT = new MTSQLServer().wRead(mSql, null, false); grdPhieuNXCT.DataSource = oTblNXCT; SysPar.SetGridReadOnly(true, gvPhieuNXCT); } 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 void fdoAbort() { DisableEditCode(); try { MTSQLServer.getMTSQLServer().Abort(SQLAdaptor, DSetMain.Tables["DM_SANPHAM"]); SysPar.SetGridReadOnly(true, gvSanPham); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "ABORT"); } catch { } }
private void BindData() { try { cbNguyente.SelectedIndex = 0; txtTygia.Text = "1"; txtMaKho.Text = ""; txtTenkho.Text = ""; txtMadv.Text = ""; txtTendonvi.Text = ""; txtMald.Text = ""; txtLydo.Text = ""; txtNguoigiao.Text = ""; txtGhichu.Text = ""; if (pPhieuNXID != "") { String mSql = String.Format("SELECT A.*,B.Tenkho,C.Tenkh,D.Lydo FROM NX_PHIEUNX A LEFT JOIN DM_KHO B ON A.Makho=B.Makho " + "LEFT JOIN DM_KHACHHANG C ON A.Makh=c.Makh LEFT JOIN DM_LYDO D ON A.Mald=d.Mald " + " WHERE Phieunxid='{0}'", pPhieuNXID); otblPNX = new MTSQLServer().wRead(mSql, null, false); if (otblPNX != null) { foreach (DataRow vR in otblPNX.Rows) { txtSophieu.Text = vR["Sophieu"].ToString(); dtpNgaylap.EditValue = vR["Ngayct"].ToString() != "" ? Convert.ToDateTime(vR["Ngayct"].ToString()).ToShortDateString() : ""; dtpNgayPS.EditValue = vR["Ngayps"].ToString() != "" ? Convert.ToDateTime(vR["Ngayps"].ToString()).ToShortDateString() : ""; txtSoctgoc.Text = vR["Soctgoc"].ToString(); cbNguyente.SelectedText = vR["Loaitien"].ToString(); txtTygia.Text = vR["Tygia"].ToString(); txtMaKho.Text = vR["Makho"].ToString(); txtTenkho.Text = vR["Tenkho"].ToString(); txtMadv.Text = vR["Makh"].ToString(); txtTendonvi.Text = vR["Tenkh"].ToString(); txtMald.Text = vR["Mald"].ToString(); txtLydo.Text = vR["Lydo"].ToString(); txtNguoigiao.Text = vR["Giaonhan"].ToString(); txtGhichu.Text = vR["Ghichu"].ToString(); } } } otblPNXCT = new MTSQLServer().wRead(String.Format("SELECT * FROM NX_PHIEUNXCT where Phieunxid='{0}' ORDER BY Phieunxctid asc", pPhieuNXID), null, false); grdPhieuXuat.DataSource = otblPNXCT; SysPar.SetGridReadOnly(true, gvPhieuXuat); } catch { } }
private void fdoEdit() { setReadOnly(false); MTGlobal.SetToolStripButtonAction(pACT_ROLE, MTButton, "EDIT"); isEdit = true; txtSophieu.Focus(); if (SysPar.SetGridReadOnly(false, gvPhieu)) { gvPhieu.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom; gvPhieu.FocusedRowHandle = GridControl.NewItemRowHandle; gvPhieu.FocusedColumn = gvPhieu.Columns[0]; gvPhieu.ShowEditor(); } }
private void BindData() { cbNguyenTe.SelectedIndex = 0; txtMaDT.Text = ""; txtTenDoiTuong.Text = ""; txtHoTen.Text = ""; txtDiaChi.Text = ""; txtMaLD.Text = ""; txtLD.Text = ""; txtManv.Text = ""; txtTennv.Text = ""; txtGhiChu.Text = ""; if (pPhieuTCID != "") { String mSql = String.Format("select A.*, B.Tenkh, B.Diachi, C.Lydo, C.TKNo, C.TKCo, D.Tennv from TC_PHIEUTC A left join DM_KHACHHANG B on A.Madt = B.Makh left join DM_LYDO C on A.Mald = C.Mald left join DM_NHANVIEN D on A.Mant = D.Manv where A.Phieutcid = '{0}'", pPhieuTCID); otblPTC = new MTSQLServer().wRead(mSql, null, false); if (otblPTC != null) { foreach (DataRow vR in otblPTC.Rows) { txtSoPhieu.Text = vR["Sophieu"].ToString(); txtMaDT.Text = vR["Madt"].ToString(); txtTenDoiTuong.Text = vR["Tenkh"].ToString(); txtDiaChi.Text = vR["Diachi"].ToString(); txtHoTen.Text = vR["Hoten"].ToString(); txtMaLD.Text = vR["Mald"].ToString(); txtLD.Text = vR["Lydo"].ToString(); txtManv.Text = vR["Mant"].ToString(); txtTennv.Text = vR["Tennv"].ToString(); txtGhiChu.Text = vR["Ghichu"].ToString(); txtSoCT.Text = vR["Soctgoc"].ToString(); txtNgayCT.EditValue = vR["Ngayct"].ToString() != "" ? Convert.ToDateTime(vR["Ngayct"].ToString()).ToShortDateString() : ""; txtNgayPS.EditValue = vR["Ngayps"].ToString() != "" ? Convert.ToDateTime(vR["Ngayps"].ToString()).ToShortDateString() : ""; cbNguyenTe.SelectedValue = vR["Loaitien"].ToString(); txtTyGia.Text = vR["Tygia"].ToString(); TKNo = vR["TKNo"].ToString(); TKCo = vR["TKCo"].ToString(); } } } otblPTCCT = new MTSQLServer().wRead(String.Format("SELECT * FROM TC_PHIEUTCCT where Phieutcid='{0}' ORDER BY Phieutcctid asc", pPhieuTCID), null, false); grdPhieuThuCT.DataSource = otblPTCCT; SysPar.SetGridReadOnly(true, gvPhieuThuCT); }
private void fdoAdd() { if (SysPar.SetGridReadOnly(false, gvNguoiDung)) { gvNguoiDung.AddNewRow(); gvNguoiDung.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom; gvNguoiDung.FocusedRowHandle = GridControl.NewItemRowHandle; gvNguoiDung.FocusedColumn = colmanv; gvNguoiDung.Focus(); gvNguoiDung.ShowEditor(); MTGlobal.SetToolStripButtonAction(MTROLE, MTButton, "ADD"); } colmanv.OptionsColumn.AllowEdit = true; }
private void fdoEdit() { setReadOnly(false); MTGlobal.SetToolStripButtonAction(pACT_ROLE, MTButton, "EDIT"); isEdit = true; txtMaDT.Focus(); if (SysPar.SetGridReadOnly(false, gvPhieuThuCT)) { gvPhieuThuCT.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom; //grdPhieuThuCT.DataSource = new modPhieuTC().dtPhieuTCCT(); gvPhieuThuCT.FocusedRowHandle = GridControl.NewItemRowHandle; gvPhieuThuCT.FocusedColumn = gvPhieuThuCT.VisibleColumns[0]; gvPhieuThuCT.ShowEditor(); } }