Example #1
0
        private void btnXoa_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (XtraMessageBox.Show("Bạn có chắc muốn xóa ?", "CẢNH BÁO", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }
            string Ma = PThu == true?gvMain.GetFocusedRowCellValue("MaPT").ToString() : gvMain.GetFocusedRowCellValue("MaPC").ToString();

            if (PThu == true)
            {
                BUS_CongNo.XoaPT(Ma);

                Action.Module     = "Phiếu Thu Tiền";
                Action.ActionName = "Xóa";
                Action.Reference  = Ma;
                Action.LuuThongTin();

                gcMain.DataSource = BUS_CongNo.LoadPhieuThu();
            }
            else
            {
                BUS_CongNo.XoaPC(Ma);

                Action.Module     = "Phiếu Chi Tiền";
                Action.ActionName = "Xóa";
                Action.Reference  = Ma;
                Action.LuuThongTin();

                gcMain.DataSource = BUS_CongNo.LoadPhieuChi();
            }
        }
Example #2
0
 private void fPhieuThu_Activated(object sender, EventArgs e)
 {
     if (PThu == true)
     {
         gcMain.DataSource = BUS_CongNo.LoadPhieuThu();
     }
     else
     {
         gcMain.DataSource = BUS_CongNo.LoadPhieuChi();
     }
 }
Example #3
0
        private void Init()
        {
            if (PThu == true)
            {
                gcMain.DataSource = BUS_CongNo.LoadPhieuThu();

                gvMain.Columns[0].FieldName = "MaPT";
                gvMain.Columns[1].FieldName = "MaBH";
                gvMain.Columns[2].FieldName = "NgayLap";
                gvMain.Columns[3].FieldName = "MaKH";
                gvMain.Columns[4].FieldName = "TenKH";
                gvMain.Columns[5].FieldName = "SoTienTra";
                gvMain.Columns[6].FieldName = "GhiChu";

                Text = "Danh Sách Phiếu Thu";
                QuyenNguoiDung.LayQuyenNguoiDungTheoChucNang("btnThuTien");
                if (QuyenNguoiDung.Xoa == false)
                {
                    btnXoa.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
                }
            }
            else
            {
                gcMain.DataSource = BUS_CongNo.LoadPhieuChi();

                gvMain.Columns[0].FieldName = "MaPC";
                gvMain.Columns[1].FieldName = "MaBH";
                gvMain.Columns[2].FieldName = "NgayLap";
                gvMain.Columns[3].FieldName = "MaNCC";
                gvMain.Columns[4].FieldName = "TenNCC";
                gvMain.Columns[5].FieldName = "SoTienTra";
                gvMain.Columns[6].FieldName = "GhiChu";

                gvMain.Columns[2].Caption = "Mã NCC";
                gvMain.Columns[3].Caption = "Nhà Cung Cấp";
                Text = "Danh Sách Phiếu Chi";

                QuyenNguoiDung.LayQuyenNguoiDungTheoChucNang("btnTraTien");
                if (QuyenNguoiDung.Xoa == false)
                {
                    btnXoa.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
                }
            }

            gvMain.IndicatorWidth          = 50;
            gvMain.CustomDrawRowIndicator += gvMain_CustomDrawRowIndicator;

            gcMain.UseEmbeddedNavigator = true;
            gcMain.EmbeddedNavigator.Buttons.Append.Visible     = false;
            gcMain.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            gcMain.EmbeddedNavigator.Buttons.Edit.Visible       = false;
            gcMain.EmbeddedNavigator.Buttons.EndEdit.Visible    = false;
            gcMain.EmbeddedNavigator.Buttons.Remove.Visible     = false;
        }
Example #4
0
 private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (PThu == true)
     {
         gcMain.DataSource = BUS_CongNo.LoadPhieuThu();
     }
     else
     {
         gcMain.DataSource = BUS_CongNo.LoadPhieuChi();
     }
 }
Example #5
0
        private void Init()
        {
            if (PThu == true)
            {
                table = BUS_CongNo.LoadPhieuThu();
            }
            else
            {
                table = BUS_CongNo.LoadPhieuChi();
            }

            gleNhanVien.Properties.DataSource    = BUS_NhanVien.LayNhanVienDonGian();
            gleNhanVien.Properties.ValueMember   = "EMPLOYEE_ID";
            gleNhanVien.Properties.DisplayMember = "EMPLOYEE_Name";
            gleNhanVien.EditValue = ((DataTable)gleNhanVien.Properties.DataSource).Rows[0]["EMPLOYEE_ID"];

            txtPhieu.Enabled = false;
            PhatSinhMa();
            LoadDuLieu();
        }