Exemplo n.º 1
0
        public FrmTimKiemKhachHang(string P_KEYSEARCH)
        {
            InitializeComponent();
            dgvThongTinKhachHang.Columns["STT"].HeaderCell.Style.Font                  = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["STT"].HeaderCell.Style.Alignment             = DataGridViewContentAlignment.MiddleCenter;
            dgvThongTinKhachHang.Columns["MAKHACHHANG"].HeaderCell.Style.Font          = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["MAKHACHHANG"].HeaderCell.Style.Alignment     = DataGridViewContentAlignment.MiddleCenter;
            dgvThongTinKhachHang.Columns["MATHE"].HeaderCell.Style.Font                = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["MATHE"].HeaderCell.Style.Alignment           = DataGridViewContentAlignment.MiddleCenter;
            dgvThongTinKhachHang.Columns["TENKHACHHANG"].HeaderCell.Style.Font         = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["TENKHACHHANG"].HeaderCell.Style.Alignment    = DataGridViewContentAlignment.MiddleCenter;
            dgvThongTinKhachHang.Columns["DIACHI"].HeaderCell.Style.Font               = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["DIACHI"].HeaderCell.Style.Alignment          = DataGridViewContentAlignment.MiddleCenter;
            dgvThongTinKhachHang.Columns["DIENTHOAI"].HeaderCell.Style.Font            = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["DIENTHOAI"].HeaderCell.Style.Alignment       = DataGridViewContentAlignment.MiddleCenter;
            dgvThongTinKhachHang.Columns["CANCUOC_CONGDAN"].HeaderCell.Style.Font      = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["CANCUOC_CONGDAN"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvThongTinKhachHang.Columns["NGAYSINH"].HeaderCell.Style.Font             = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["NGAYSINH"].HeaderCell.Style.Alignment        = DataGridViewContentAlignment.MiddleCenter;
            dgvThongTinKhachHang.Columns["NGAYDACBIET"].HeaderCell.Style.Font          = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["NGAYDACBIET"].HeaderCell.Style.Alignment     = DataGridViewContentAlignment.MiddleCenter;
            dgvThongTinKhachHang.Columns["SODIEM"].HeaderCell.Style.Font               = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["SODIEM"].HeaderCell.Style.Alignment          = DataGridViewContentAlignment.MiddleCenter;
            dgvThongTinKhachHang.Columns["TONGTIEN"].HeaderCell.Style.Font             = new Font("Arial", 15F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            dgvThongTinKhachHang.Columns["TONGTIEN"].HeaderCell.Style.Alignment        = DataGridViewContentAlignment.MiddleCenter;

            dgvThongTinKhachHang.Columns["NGAYDACBIET"].Visible     = false;
            dgvThongTinKhachHang.Columns["CANCUOC_CONGDAN"].Visible = false;
            dgvThongTinKhachHang.Columns["SODIEM"].Visible          = false;
            dgvThongTinKhachHang.Columns["TONGTIEN"].Visible        = false;
            BindingList <TIMKIEM_DTO> _comboItems = new BindingList <TIMKIEM_DTO>();

            _comboItems.Add(new TIMKIEM_DTO {
                VALUE = 0, TEXT = "Mã thẻ"
            });
            _comboItems.Add(new TIMKIEM_DTO {
                VALUE = 1, TEXT = "Mã khách hàng"
            });
            _comboItems.Add(new TIMKIEM_DTO {
                VALUE = 2, TEXT = "Tên khách hàng"
            });
            _comboItems.Add(new TIMKIEM_DTO {
                VALUE = 3, TEXT = "Số điện thoại"
            });
            _comboItems.Add(new TIMKIEM_DTO {
                VALUE = 4, TEXT = "Số chứng minh thư"
            });
            _comboItems.Add(new TIMKIEM_DTO {
                VALUE = 5, TEXT = "Số điểm"
            });
            cboDieuKienTimKiem.DataSource    = _comboItems;
            cboDieuKienTimKiem.DisplayMember = "TEXT";
            cboDieuKienTimKiem.ValueMember   = "VALUE";
            cboDieuKienTimKiem.SelectedIndex = 0;
            txtDieuKienTimKiem.Text          = P_KEYSEARCH;
            List <KHACHHANG_DTO> _LST_KHACHHANG_DTO = new List <KHACHHANG_DTO>();

            _LST_KHACHHANG_DTO = FrmThanhToanService.TIMKIEM_KHACHHANG_FROM_ORACLE(P_KEYSEARCH, 1, cboDieuKienTimKiem.SelectedIndex, Session.Session.CurrentUnitCode);
            BINDING_DATA_KHACHHANG_TO_GRIDVIEW(_LST_KHACHHANG_DTO);
        }
Exemplo n.º 2
0
        private void THANHTOAN_HOADON_BANLE_TRALAI()
        {
            bool   success          = false;
            string TONGTIEN_BANGCHU = ConvertSoThanhChu.ChuyenDoiSoThanhChu(_NVGDQUAY_ASYNCCLIENT_DTO_GLOBAL.THANHTIEN);

            try
            {
                LUU_DULIEU(_NVGDQUAY_ASYNCCLIENT_DTO_GLOBAL);
            }
            catch
            {
                MessageBox.Show("CẢNH BÁO ! XẢY RA LỖI KHI LƯU HÓA ĐƠN NÀY, HÃY LƯU LẠI HÓA ĐƠN ĐỂ KIỂM TRA ! XIN CẢM ƠN ");
            }
            try
            {
                string MA_TEN_KHACHHANG = "";
                if (Config.CheckConnectToServer())
                {
                    MA_TEN_KHACHHANG = FrmThanhToanService.LAY_MA_TEN_KHACHHANG_FROM_ORACLE(_NVGDQUAY_ASYNCCLIENT_BILL_GLOBAL.MAKHACHHANG);
                }
                else
                {
                    MA_TEN_KHACHHANG = FrmThanhToanService.LAY_MA_TEN_KHACHHANG_FROM_SQLSERVER(_NVGDQUAY_ASYNCCLIENT_BILL_GLOBAL.MAKHACHHANG);
                }
                using (frmPrintBill_TraLai frmBanTraLai = new frmPrintBill_TraLai())
                {
                    try
                    {
                        BILL_DTO infoBill = new BILL_DTO()
                        {
                            ADDRESS      = Session.Session.CurrentAddress,
                            CONLAI       = _NVGDQUAY_ASYNCCLIENT_BILL_GLOBAL.TIEN_TRALAI_KHACH,
                            PHONE        = Session.Session.CurrentPhone,
                            MAKH         = MA_TEN_KHACHHANG,
                            DIEM         = _NVGDQUAY_ASYNCCLIENT_BILL_GLOBAL.SODIEM,
                            INFOTHUNGAN  = "THU NGÂN: " + Session.Session.CurrentTenNhanVien,
                            MA_GIAODICH  = _NVGDQUAY_ASYNCCLIENT_BILL_GLOBAL.MA_GIAODICH,
                            THANHTIENCHU = TONGTIEN_BANGCHU,
                            TIENKHACHTRA = _NVGDQUAY_ASYNCCLIENT_BILL_GLOBAL.TIENKHACH_TRA,
                            TENCUAHANG   = Session.Session.CurrentNameStore
                        };
                        frmBanTraLai.PrintInvoice_BanLeTraLai(infoBill, _NVGDQUAY_ASYNCCLIENT_BILL_GLOBAL);
                    }
                    catch
                    {
                    }
                    finally
                    {
                        this.handler(true);
                        this.Dispose();
                        frmBanTraLai.Dispose();
                        frmBanTraLai.Refresh();
                    }
                }
            }
            catch (Exception ex)
            {
                WriteLogs.LogError(ex);
            }
        }
Exemplo n.º 3
0
        private void btnTimKiemKhachHang_Click(object sender, System.EventArgs e)
        {
            string P_KEYSEARCH        = txtDieuKienTimKiem.Text;
            int    P_USE_TIMKIEM_ALL  = 0;
            int    P_DIEUKIEN_TIMKIEM = cboDieuKienTimKiem.SelectedIndex;
            List <KHACHHANG_DTO> _LST_KHACHHANG_DTO = new List <KHACHHANG_DTO>();

            _LST_KHACHHANG_DTO = FrmThanhToanService.TIMKIEM_KHACHHANG_FROM_ORACLE(P_KEYSEARCH, P_USE_TIMKIEM_ALL, P_DIEUKIEN_TIMKIEM, Session.Session.CurrentUnitCode);
            BINDING_DATA_KHACHHANG_TO_GRIDVIEW(_LST_KHACHHANG_DTO);
        }
Exemplo n.º 4
0
 private void txtDieuKienTimKiem_TextChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtDieuKienTimKiem.Text))
     {
         string P_KEYSEARCH        = txtDieuKienTimKiem.Text;
         int    P_USE_TIMKIEM_ALL  = 1;
         int    P_DIEUKIEN_TIMKIEM = cboDieuKienTimKiem.SelectedIndex;
         List <KHACHHANG_DTO> _LST_KHACHHANG_DTO = new List <KHACHHANG_DTO>();
         _LST_KHACHHANG_DTO = FrmThanhToanService.TIMKIEM_KHACHHANG_FROM_ORACLE(P_KEYSEARCH, P_USE_TIMKIEM_ALL, P_DIEUKIEN_TIMKIEM, Session.Session.CurrentUnitCode);
         BINDING_DATA_KHACHHANG_TO_GRIDVIEW(_LST_KHACHHANG_DTO);
     }
 }