Exemplo n.º 1
0
        private void LoadChungTuHeader()
        {
            LoaiChungTu      = Business.ChungTu.LoaiChungTu;
            TrangThaiDonHang = Business.ChungTu.TrangThai;
            Draft            = Business.ChungTu.Draft;

            bteKhoXuat.Tag    = DMKhoDataProvider.GetKhoByIdInfo(Business.ChungTu.IdKho);
            bteKhoXuat.Text   = bteKhoXuat.Tag != null ? ((DMKhoInfo)bteKhoXuat.Tag).TenKho : "";
            bteKhachHang.Tag  = DmDoiTuongProvider.GetDmDoiTuongInfoFromOid(Business.ChungTu.IdDoiTuong);
            bteKhachHang.Text = bteKhachHang.Tag != null ? ((DMDoiTuongInfo)bteKhachHang.Tag).TenDoiTuong : "";
            IdKhoSelected     = Business.ChungTu.IdKho;
            txtGhiChu.Text    = Business.ChungTu.GhiChu;

            txtSoOrderKH.Text     = Business.ChungTu.SoChungTu;
            mstNgayLapPhieu.Value = Business.ChungTu.NgayLap;
            txtSoPhieu.Text       = Business.ChungTu.SoPhieuXuat;
            try
            {
                mstNgayXuat.Value = Business.ChungTu.NgayXuatHang;
            }
            catch
            {
                mstNgayXuat.Value = DateTime.Now;
            }

            cboNhanVien.SelectedValue = Business.ChungTu.IdNhanVienGiao;
            bteNhanVien.Tag           = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(Business.ChungTu.IdNhanVienGiao);
            bteNhanVien.Text          = bteNhanVien.Tag != null ? ((DMNhanVienInfo)bteNhanVien.Tag).HoTen : "";
            txtDienThoai.Text         = Business.ChungTu.DienThoai;
            txtHoTenKhachHang.Text    = Business.ChungTu.HoTen;
            txtDiaChi.Text            = Business.ChungTu.DiaChi;
        }
Exemplo n.º 2
0
        private void LoadChungTuHeader()
        {
            LoadTrungTam();
            LoadKhoXuat();
            LoadKhachHang();

            txtSoOrderKH.Text     = ChungTu.SoChungTu;
            mstNgayLapPhieu.Value = ChungTu.NgayLap;
            txtSoChungTuGoc.Text  = ChungTu.SoChungTuGoc;

            txtSoPhieuDC.Text = ChungTu.SoPhieuDC;

            bteThuongVien.Tag         = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(ChungTu.IdNhanVien);
            bteThuongVien.Text        = bteThuongVien.Tag != null ? ((DMNhanVienInfo)bteThuongVien.Tag).HoTen : "";
            cboGiaoHang.SelectedIndex = ChungTu.GiaoNhan;

            try
            {
                mstNgayHenGiaoHang.Value = ChungTu.NgayHenGiaoHang;
            }
            catch
            {
                mstNgayHenGiaoHang.Value = CommonProvider.Instance.GetSysDate();
            }

            txtGhiChu.Text = ChungTu.GhiChu;

            txtSoSerie.Text        = ChungTu.SoSeri;
            bteKhachLe.Tag         = DmDoiTuongProvider.GetDmDoiTuongInfoFromOid(ChungTu.IdKhachLe);
            bteKhachLe.Text        = bteKhachHang.Tag != null ? ((DMDoiTuongInfo)bteKhachHang.Tag).TenDoiTuong : "";
            txtCongTy.Text         = ChungTu.CongTy;
            txtHoTenKhachHang.Text = ChungTu.HoTen;
            txtDiaChi.Text         = ChungTu.DiaChi;
            txtSoHDDaMua.Text      = ChungTu.SoHDDaMua;
        }
        //fill dữ liệu vào control
        private void LoadOldChungTuInfor(ChungTuBanHangInfor lstHD)
        {
            grbChungTuMua.Text = "Thông tin phiếu mua hàng: " +
                                 (String.IsNullOrEmpty(lstHD.TenTrungTam)
                          ? ""
                          : (lstHD.TenTrungTam + (String.IsNullOrEmpty(lstHD.TenKho) ? "" : "(" + lstHD.TenKho + ")")));
            _IdTrungTam               = lstHD.IdTrungTam;
            txtSoGiaoDich.Text        = lstHD.SoChungTu;
            txtSoPhieuXuat.Text       = lstHD.SoPhieuXuat;
            dteNgayLap.EditValue      = lstHD.NgayLap;
            dteNgayXuat.EditValue     = lstHD.NgayXuatHang;
            txtKiHieu.Text            = lstHD.KyHieu;
            txtSoHoaDon.Text          = lstHD.SoSeri;
            txtTenDoiTuong.Text       = lstHD.HoTen;
            txtCongTy.Text            = lstHD.CongTy;
            cboGioiTinh.SelectedIndex = lstHD.GioiTinh;
            txtCMND.Text              = lstHD.SoCMND;
            txtSoDienThoai.Text       = lstHD.MaSoThue;
            txtEmail.Text             = lstHD.Email;
            txtDiaChiHD.Text          = lstHD.DiaChiHoaDon;
            txtDiaChiGH.Text          = lstHD.DiaChiGiaoHang;
            txtSoDienThoai.Text       = lstHD.DienThoai;

            if (lstHD.IdNhanVien != 0)
            {
                DMNhanVienInfo thuongvien = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(lstHD.IdNhanVien);
                if (thuongvien != null)
                {
                    bteThuongVien.Tag  = thuongvien;
                    bteThuongVien.Text = thuongvien.HoTen;
                }
            }

            if (lstHD.IdDoiTuong != 0)
            {
                DMDoiTuongInfo doituong = DmDoiTuongProvider.GetDmDoiTuongInfoFromOid(lstHD.IdDoiTuong);
                if (doituong != null)
                {
                    txtKhachHang.Tag  = doituong;
                    txtKhachHang.Text = doituong.TenDoiTuong;
                }
            }
            if (lstHD.IdKhachLe != 0)
            {
                DMDoiTuongInfo khachle = DmDoiTuongProvider.GetDmDoiTuongInfoFromOid(lstHD.IdKhachLe);
                if (khachle != null)
                {
                    bteKhachLe.Tag  = khachle;
                    bteKhachLe.Text = khachle.TenDoiTuong;
                }
            }

            txtTongTienTT.Text   = Common.Double2Str(lstHD.TongTienThanhToan);
            txtTienThucTra.Text  = Common.Double2Str(lstHD.TienThanhToanThuc);
            txtTienConNo.Text    = Common.Double2Str(lstHD.TienConNo);
            txtTienTraKhach.Text = "0";
            txtTienNoKhach.Text  = txtTienThucTra.Text;
        }
Exemplo n.º 4
0
 private void LoadTruongCa()
 {
     TruongCaSelected = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(Declare.IdTruongCa);
     if (TruongCaSelected != null)
     {
         bteTruongCa.Text = TruongCaSelected.HoTen;
         bteTruongCa.Tag  = TruongCaSelected;
     }
 }
Exemplo n.º 5
0
 private void LoadThuNgan()
 {
     ThuNganSelected = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(Declare.IdThuNgan);
     if (ThuNganSelected != null)
     {
         bteThuNgan.Text = ThuNganSelected.HoTen;
         bteThuNgan.Tag  = ThuNganSelected;
     }
 }
Exemplo n.º 6
0
        private void LoadQLTrucTiep(int idQLTrucTiep)
        {
            DMNhanVienInfo nv = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(idQLTrucTiep);

            if (nv != null)
            {
                bteQLTrucTiep.Text = nv.HoTen;
                bteQLTrucTiep.Tag  = nv;
            }
        }
        private void LoadNhanVienGiaoNhan()
        {
            //load nhan vien
            int            idNhanVien = ChiTietGiaoNhan.IdNhanVien > 0 ? ChiTietGiaoNhan.IdNhanVien : nguoiDung.IdNhanVien;
            DMNhanVienInfo nhanVien   = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(idNhanVien);

            if (nhanVien != null)
            {
                bteThuongVien.Tag  = nhanVien;
                bteThuongVien.Text = nhanVien.HoTen;
                txtMaNhanVien.Text = nhanVien.MaNhanVien;
            }
            if (ChiTietGiaoNhan.IdNhanVien2 > 0)
            {
                DMNhanVienInfo nv = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(ChiTietGiaoNhan.IdNhanVien2);
                if (nv != null)
                {
                    bteThuongVien2.Tag  = nv;
                    bteThuongVien2.Text = nv.HoTen;
                    txtMaNhanVien2.Text = nv.MaNhanVien;
                }
            }
            if (ChiTietGiaoNhan.IdNhanVien3 > 0)
            {
                DMNhanVienInfo nv = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(ChiTietGiaoNhan.IdNhanVien3);
                if (nv != null)
                {
                    bteThuongVien3.Tag  = nv;
                    bteThuongVien3.Text = nv.HoTen;
                    txtMaNhanVien3.Text = nv.MaNhanVien;
                }
            }
            //load lai xe
            if (ChiTietGiaoNhan.IdLaiXe > 0)
            {
                DMNhanVienInfo nv = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(ChiTietGiaoNhan.IdLaiXe);
                if (nv != null)
                {
                    bteLaiXe.Tag  = nv;
                    bteLaiXe.Text = nv.HoTen;
                }
            }
            //load doi tac
            if (ChiTietGiaoNhan.IdDoiTac > 0)
            {
                DMNhanVienInfo dt = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(ChiTietGiaoNhan.IdDoiTac);
                if (dt != null)
                {
                    bteDoiTac.Tag  = dt;
                    bteDoiTac.Text = dt.HoTen;
                }
            }
            txtNhanVienDoiTac.Text = ChiTietGiaoNhan.NhanVienDoiTac;
        }
        private void frm_PhieuDeNghiXuatTieuHaoNew_Load(object sender, EventArgs e)
        {
            if (chungTuInfo == null || chungTuInfo.IdChungTu == 0)
            {
                dteNgay.Text      = Convert.ToString(CommonProvider.Instance.GetSysDate());
                dteNgay.BackColor = Color.White;
                dteNgay.ForeColor = Color.Black;
                //bteTVDN.Text = Declare.UserName;
                txtSoPhieu.Text  = CommonProvider.Instance.GetSoPhieu("PXTH");
                txtNguoiLap.Text = Declare.UserName;
                IsAdd            = true;
            }
            else
            {
                txtSoPhieu.Text     = business.ChungTu.SoChungTu;
                txtNguoiLap.Text    = business.ChungTu.NguoiTao;
                dteNgay.DateTime    = business.ChungTu.NgayLap;
                bteNguoiQuanLy.Text = business.ChungTu.NguoiQuanLy;
                bteTVDN.Text        = business.ChungTu.HoTen;
                bteTVDN.Tag         = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(business.ChungTu.IdNhanVien);
                bteTVDN.Enabled     = false;
                bteTrungTam.Text    = business.ChungTu.TenTrungTam;
                bteTrungTam.Tag     = DMTrungTamDataProvider.GetTrungTamByIdInfo(business.ChungTu.IdTrungTam);
                bteNguoiQuanLy.Tag  = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(business.ChungTu.IdNguoiQuanLy);
                bteKho.Text         = business.ChungTu.TenKho;
                bteKho.Tag          = DMKhoDataProvider.GetKhoByIdInfo(business.ChungTu.IdKho);
                txtGhiChu.Text      = business.ChungTu.GhiChu;
                txtGhiChu.Enabled   = false;
                btnCapNhat.Enabled  = false;
                btnThemSP.Enabled   = false;
                btnXoaSP.Enabled    = false;
                bteKho.Enabled      = false;
                bteTrungTam.Enabled = false;
            }

            bdSource = new BindingSource();
            if (business.ListChiTietChungTu != null)
            {
                bdSource.DataSource = new BindingList <DeNghiXuatTieuHaoChiTietInfonew>(business.ListChiTietChungTu);
                bdSource.AddingNew += new AddingNewEventHandler(bdSource_AddingNew);
                grcList.DataSource  = bdSource;
            }
            dteNgay.Enabled = false;
            LoadChiPhi();
            LoadPhongBan();
            LoadNganh();
        }
        private void LoadThuNgan()
        {
            try
            {
                DMNhanVienInfo nv = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(nguoiDung.IdNhanVien);
                if (nv != null)
                {
                    bteThuNgan.Text = nv.HoTen;
                    bteThuNgan.Tag  = nv;
                }
            }
            catch (System.Exception ex)
            {
#if DEBUG
                MessageBox.Show("Lỗi ngoại lệ: " + ex.ToString(), Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error);
#else
                MessageBox.Show("Lỗi ngoại lệ: " + ex.Message, Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error);
#endif
            }
        }
Exemplo n.º 10
0
        private void frmHT_AddNguoiDung_Load(object sender, EventArgs e)
        {
            LoadNhomNguoiDung();
            if (objNguoiDung != null)
            {
                txtUserName.ReadOnly       = true;
                txtPassword.ReadOnly       = true;
                txtRetypePassword.ReadOnly = true;

                txtFullName.Text       = objNguoiDung.TenDayDu;
                txtUserName.Text       = objNguoiDung.TenDangNhap;
                txtPassword.Text       = objNguoiDung.MatKhau;
                txtRetypePassword.Text = objNguoiDung.MatKhau;
                chkSuDung.Checked      = objNguoiDung.SuDung;// (objNguoiDung.SuDung == 1 ? true : false);
                chkSuperUser.Checked   = Common.Int2Bool(objNguoiDung.SupperUser);
                DMNhanVienInfo nv = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(objNguoiDung.IdNhanVien);
                bteThuongVien.Text     = nv.HoTen;
                bteThuongVien.Tag      = nv;
                cboGroup.SelectedValue = objNguoiDung.IdNhomNguoiDung;

                if (objNguoiDung.ThoiGianApDung == -1)
                {
                    chkNeverExpired.Checked         = true;
                    chkForceChangeOnExpired.Checked = false;
                    chkForceChangeOnExpired.Enabled = false;
                    txtExpiredIn.Enabled            = false;
                    txtExpiredIn.Text = "30";
                }
                else
                {
                    chkNeverExpired.Checked         = false;
                    chkNeverExpired.Enabled         = false;
                    chkForceChangeOnExpired.Checked = true;
                    txtExpiredIn.Enabled            = true;
                    txtExpiredIn.Text = objNguoiDung.ThoiGianApDung == -1 ? "30" :
                                        objNguoiDung.ThoiGianApDung.ToString();
                }

                chkForceChangeAtFirst.Checked = objNguoiDung.ChangeOnNext;
            }
        }
Exemplo n.º 11
0
 private void frm_PhieuNhapTieuHao_Load(object sender, EventArgs e)
 {
     business.ListChiTietChungTu = XuatTieuHaoProvidernew.Instance.GetListChiTietChungTuByIdChungTu(OID != 0 ? OID : idChungTuGoc);
     grcList.DataSource          = business.ListChiTietChungTu;
     if (NgayXuat == Convert.ToString(DateTime.MinValue))
     {
         dteNgay.Text = Convert.ToString(CommonProvider.Instance.GetSysDate());
     }
     else
     {
         dteNgay.Text = NgayXuat;
     }
     bteTVDN.Text        = NguoiLap;
     bteTrungTam.Text    = TenTrungTam;
     bteKho.Text         = TenKho;
     txtGhiChu.Text      = GhiChu;
     bteTVX.Text         = NguoiXuat;
     bteTVX.Tag          = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(IdNhanVienGiao);
     txtSoPhieu.Text     = SoChungTu;
     bteTVDN.Enabled     = IsSupperUser();
     bteTrungTam.Enabled = false;
     bteKho.Enabled      = false;
     dteNgay.Enabled     = false;
     if (trangThai == Convert.ToInt32(TrangThaiDuyet.DA_NHAP))
     {
         btnCapNhat.Enabled = false;
         txtGhiChu.Enabled  = false;
         dteNgay.Enabled    = false;
         bteTVX.Enabled     = false;
     }
     else
     {
         //colSoLuong.RealColumnEdit = false;
     }
     LoadChiPhi();
     LoadPhongBan();
     LoadNganh();
 }
        private void LoadChungTuHeader()
        {
            Draft       = Business.ChungTu.Draft;
            TrangThai   = Business.ChungTu.TrangThai;
            LoaiChungTu = Business.ChungTu.LoaiChungTu;
            _IdTrungTam = Business.ChungTu.IdTrungTam;

            bteKhoXuat.Tag      = DMKhoDataProvider.GetKhoByIdInfo(Business.ChungTu.IdKho);
            bteKhoXuat.Text     = bteKhoXuat.Tag != null ? ((DMKhoInfo)bteKhoXuat.Tag).TenKho : "";
            txtSoPhieuNhap.Text = Business.ChungTu.SoChungTu;
            txtGhiChu.Text      = Business.ChungTu.GhiChu;
            try
            {
                dteNgayNhap.EditValue = Business.ChungTu.NgayLap;
            }
            catch (Exception)
            {
                dteNgayNhap.EditValue = CommonProvider.Instance.GetSysDate();
            }

            try
            {
                dteNgayXacNhan.EditValue = Business.ChungTu.NgayXuatHang;
            }
            catch (Exception)
            {
                dteNgayXacNhan.EditValue = CommonProvider.Instance.GetSysDate();
            }

            lueLyDo.EditValue = Business.ChungTu.IdLyDoGiaoDich;

            grbChungTuMua.Text = "Thông tin phiếu mua hàng: " +
                                 (String.IsNullOrEmpty(Business.ChungTu.TenTrungTam)
                          ? ""
                          : (Business.ChungTu.TenTrungTam + (String.IsNullOrEmpty(Business.ChungTu.TenKho) ? "" : "(" + Business.ChungTu.TenKho + ")")));
            txtSoGiaoDich.Text  = Business.ChungTu.SoChungTuGoc;
            txtSoPhieuXuat.Text = Business.ChungTu.SoPhieuXuat;
            try
            {
                dteNgayLap.EditValue = Business.ChungTu.NgayHenGiaoHang;
            }
            catch (Exception)
            {
                dteNgayLap.EditValue = CommonProvider.Instance.GetSysDate();
            }
            try
            {
                dteNgayXuat.EditValue = Business.ChungTu.NgayGiaoHang;
            }
            catch (Exception)
            {
                dteNgayXuat.EditValue = CommonProvider.Instance.GetSysDate();
            }
            //cboCaBanHang.SelectedIndex = Business.ChungTu.CaBanHang;
            txtKiHieu.Text            = Business.ChungTu.KyHieu;
            txtSoHoaDon.Text          = Business.ChungTu.SoSeri;
            txtTenDoiTuong.Text       = Business.ChungTu.HoTen;
            txtCongTy.Text            = Business.ChungTu.CongTy;
            cboGioiTinh.SelectedIndex = Business.ChungTu.GioiTinh;
            txtCMND.Text        = Business.ChungTu.SoCMND;
            txtSoDienThoai.Text = Business.ChungTu.DienThoai;
            txtEmail.Text       = Business.ChungTu.Email;
            txtDiaChiHD.Text    = Business.ChungTu.DiaChiHoaDon;
            txtDiaChiGH.Text    = Business.ChungTu.DiaChiGiaoHang;

            if (Business.ChungTu.IdNhanVien != 0)
            {
                DMNhanVienInfo nhanvien = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(Business.ChungTu.IdNhanVien);
                if (nhanvien != null)
                {
                    bteThuongVien.Tag  = nhanvien;
                    bteThuongVien.Text = nhanvien.HoTen;
                }
            }

            if (Business.ChungTu.IdDoiTuong != 0)
            {
                DMDoiTuongInfo doituong = DmDoiTuongProvider.GetDmDoiTuongInfoFromOid(Business.ChungTu.IdDoiTuong);
                if (doituong != null)
                {
                    txtKhachHang.Tag  = doituong;
                    txtKhachHang.Text = doituong.TenDoiTuong;
                }
            }

            if (Business.ChungTu.IdKhachLe != 0)
            {
                DMDoiTuongInfo khachle = DmDoiTuongProvider.GetDmDoiTuongInfoFromOid(Business.ChungTu.IdKhachLe);
                if (khachle != null)
                {
                    bteKhachLe.Tag  = khachle;
                    bteKhachLe.Text = khachle.TenDoiTuong;
                }
            }
            txtTongTienTT.Text  = Common.Double2Str(Business.ChungTu.TongTienHang);
            txtTienThucTra.Text = Common.Double2Str(Business.ChungTu.TongTienThanhToan);
            txtTienConNo.Text   = Common.Double2Str(Business.ChungTu.TongTienHang - Business.ChungTu.TongTienThanhToan);

            txtTienTraKhach.Text = Common.Double2Str(Business.ChungTu.TienThanhToanThuc);
            txtTienNoKhach.Text  = Common.Double2Str(Business.ChungTu.TienConNo);
        }
Exemplo n.º 13
0
 private void frm_PhieuDeNghiNhapTieuHao_Load(object sender, EventArgs e)
 {
     if (OID == 0)
     {
         dteNgay.Text      = Convert.ToString(CommonProvider.Instance.GetSysDate());
         dteNgay.BackColor = Color.White;
         dteNgay.ForeColor = Color.Black;
         //bteTVDN.Text = Declare.UserName;
         txtSoPhieu.Text = CommonProvider.Instance.GetSoPhieu("PNTH");
         IsAdd           = true;
     }
     else
     {
         txtSoPhieu.Text      = SoChungTu;
         txtSoChungTuGoc.Text = SoChungTuGoc;
         DateTime Ngaylap = business.ChungTu.NgayLap;
         dteNgay.Text        = Ngaylap.ToString();
         bteTVDN.Text        = NguoiLap;
         bteNguoiQuanLy.Text = NguoiQuanLy;
         bteTVDN.Tag         = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(IdNhanVien);
         bteNguoiQuanLy.Tag  = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(IdNguoiQuanLy);
         bteTrungTam.Text    = TenTrungTam;
         bteTrungTam.Tag     = DMTrungTamDataProvider.GetTrungTamByIdInfo(IdTrungTam);
         bteKho.Text         = TenKho;
         bteKho.Tag          = DMKhoDataProvider.GetKhoByIdInfo(IdKho);
         txtGhiChu.Text      = GhiChu;
     }
     bdSource = new BindingSource();
     if (business.ListChiTietChungTu != null)
     {
         bdSource.DataSource = new BindingList <DeNghiXuatTieuHaoChiTietInfonew>(business.ListChiTietChungTu);
         bdSource.AddingNew += new AddingNewEventHandler(bdSource_AddingNew);
         grcList.DataSource  = bdSource;
     }
     btnXoaSP.Enabled   = false;
     btnCapNhat.Enabled = false;
     btnInPhieu.Enabled = false;
     dteNgay.Enabled    = false;
     if (trangThai == Convert.ToInt32(TrangThaiDuyet.DA_NHAP) || trangThai == Convert.ToInt32(TrangThaiDuyet.CHUA_NHAP))
     {
         btnInPhieu.Enabled      = true;
         btnThemSP.Enabled       = false;
         btnXoaSP.Enabled        = false;
         btnCapNhat.Enabled      = false;
         btnLoc.Enabled          = false;
         txtGhiChu.Enabled       = false;
         txtSoChungTuGoc.Enabled = false;
         bteTVDN.Enabled         = false;
         bteTrungTam.Enabled     = false;
         bteKho.Enabled          = false;
     }
     else if (LoaiChungTu == Convert.ToInt32(TransactionType.DE_NGHI_NHAP_TIEU_HAO))
     {
         bteKho.Enabled      = false;
         bteTrungTam.Enabled = false;
     }
     else
     {
         btnXoaSP.Enabled   = false;
         btnThemSP.Enabled  = false;
         btnCapNhat.Enabled = true;
     }
     LoadChiPhi();
     LoadPhongBan();
     LoadNganh();
 }
Exemplo n.º 14
0
        protected override void LoadDataInstance()
        {
            //bteKhodi.Enabled = false;
            if (chungTuInfo.IdKhoDieuChuyen != 0)
            {
                DMKhoInfo dmKho = DMKhoDataProvider.GetKhoByIdInfo(chungTuInfo.IdKhoDieuChuyen);
                bteKhoDen.Tag     = dmKho;
                bteKhoDen.Text    = dmKho.TenKho;
                bteKhoDen.Enabled = false;
            }
            else if (chungTuInfo.TenKho != null && chungTuInfo.LoaiChungTu == Convert.ToInt32(TransactionType.DE_NGHI_NHAN_DIEU_CHUYEN) ||
                     chungTuInfo.TenKho != null && chungTuInfo.LoaiChungTu == Convert.ToInt32(TransactionType.NHAN_DIEU_CHUYEN))
            {
                bteKhoDen.Text    = chungTuInfo.TenKho;
                bteKhoDen.Enabled = false;
            }

            if (chungTuInfo.IdKhoNhanCuoi != 0)
            {
                DMKhoInfo dmKho = DMKhoDataProvider.GetKhoByIdInfo(chungTuInfo.IdKhoNhanCuoi);
                bteKhoNhanCuoi.Tag     = dmKho;
                bteKhoNhanCuoi.Text    = dmKho.TenKho;
                bteKhoNhanCuoi.Enabled = false;
            }

            if (SoCTG != null)
            {
                ChungTuXuatDieuChuyenInfo chungTuXuatDieuChuyenInfor =
                    DeNghiNhapDieuChuyenDataProvider.Instance.GetListDNNDCBySoCT(SoCTG);
                if (chungTuXuatDieuChuyenInfor.IdKho != 0)
                {
                    DMKhoInfo dmKho = DMKhoDataProvider.GetKhoByIdInfo(chungTuXuatDieuChuyenInfor.IdKho);
                    bteKhoDi.Text    = dmKho.TenKho;
                    bteKhoDi.Enabled = false;
                }
            }
            else if (chungTuInfo.TenKho != null && chungTuInfo.LoaiChungTu == Convert.ToInt32(TransactionType.DE_NGHI_XUAT_DIEU_CHUYEN) ||
                     chungTuInfo.TenKho != null && chungTuInfo.LoaiChungTu == Convert.ToInt32(TransactionType.XUAT_DIEU_CHUYEN))
            {
                bteKhoDi.Text    = chungTuInfo.TenKho;
                bteKhoDi.Enabled = false;
            }
            else if (chungTuInfo.IdChungTu == 0)
            {
                bteKhoDi.Text = "";
            }

            if (chungTuInfo.GhiChu != null)
            {
                txtGhiChu.Text = chungTuInfo.GhiChu;
            }
            else
            {
                txtGhiChu.Text = "";
            }
            if (chungTuInfo.NguoiLap != null)
            {
                txtNguoiLap.Text = chungTuInfo.NguoiLap;
            }
            else
            {
                txtNguoiLap.Text = Declare.UserName;
            }
            txtHoaDonDC.Text   = chungTuInfo.HoaDonDC;
            txtPhuongtien.Text = chungTuInfo.PhuongTien;
            if (chungTuInfo.IdNguoiVC != 0)
            {
                DMNhanVienInfo dmNv = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(chungTuInfo.IdNguoiVC);
                bteNguoiVanChuyen.Tag  = dmNv;
                bteNguoiVanChuyen.Text = dmNv.HoTen;
            }

            if (chungTuInfo.IdNguoiUyNhiem != 0)
            {
                DMNhanVienInfo dmNv = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(chungTuInfo.IdNguoiUyNhiem);
                bteNguoiUyNhiem.Tag  = dmNv;
                bteNguoiUyNhiem.Text = dmNv.HoTen;
            }
            if (chungTuInfo.IdNguoiKyDuyet != 0)
            {
                DMNhanVienInfo dmNv = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(chungTuInfo.IdNguoiKyDuyet);
                bteNguoiKyDuyet.Tag  = dmNv;
                bteNguoiKyDuyet.Text = dmNv.HoTen;
            }

            btnXoaSP.Enabled  = chungTuInfo.IdChungTu == 0;
            btnThemSP.Enabled = chungTuInfo.IdChungTu == 0;
        }
        private void InPhieuGiaoNhan()
        {
            if (LstPhieuPCGN.Count == 0)
            {
                return;
            }
            HoaDonPCGNInfo hd = new HoaDonPCGNInfo();
            double         tongtien = 0, thuctra = 0, tienno = 0;
            string         sochungtu = "";
            string         sohoadon  = "";
            string         ghichu    = "";

            foreach (ChungTuBanHangInfor ct in LstPhieuPCGN)
            {
                sochungtu = sochungtu + ct.SoChungTu + ",";
                sohoadon  = sohoadon + ct.SoSeri + ",";
                ghichu    = ghichu + ct.GhiChu + ",";
                tongtien += ct.TongTienThanhToan;
                thuctra  += ct.TienThanhToanThuc;
                tienno   += ct.TienConNo;
            }
            if (LstPhieuPCGN.Count > 0)
            {
                DMNhanVienInfo nv = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(LstPhieuPCGN[0].IdNhanVien);
                hd.ThuongVien = (nv != null ? nv.HoTen : "");
            }

            hd.SoChungTu      = sochungtu;
            hd.SoHoaDon       = sohoadon;
            hd.NgayLap        = LstPhieuPCGN[0].NgayLap;
            hd.KhachHang      = LstPhieuPCGN[0].TenDoiTuong;
            hd.CongTy         = LstPhieuPCGN[0].CongTy;
            hd.HoTen          = LstPhieuPCGN[0].HoTen;
            hd.DiaChiHoaDon   = LstPhieuPCGN[0].DiaChiHoaDon;
            hd.DiaChiGiaoHang = LstPhieuPCGN[0].DiaChiGiaoHang;
            hd.DienThoai      = LstPhieuPCGN[0].DienThoai;
            DMKhoInfo dmKho = DMKhoDataProvider.GetKhoByIdInfo(LstPhieuPCGN[0].IdKho);

            if (dmKho != null)
            {
                hd.KhoXuat = dmKho.MaKho;
            }

            //hd.HinhThucThanhToan = LstPhieuPCGN[0];
            hd.CachGiaoHang      = LstPhieuPCGN[0].GiaoNhan != 0 ? "Giao tại nhà khách" : "Giao tại công ty";
            hd.TongTienHang      = tongtien;
            hd.TienThanhToanThuc = thuctra;
            hd.TienConNo         = tienno;

            //if (ListIdChungTu.Length > 0)
            //    ListIdChungTu = ListIdChungTu.Substring(0, ListIdChungTu.Length - 1);

            hd.NhanVienKinhDoanh = "";
            foreach (ChungTuGiaoNhanChiTietInfor ct in (BindingList <ChungTuGiaoNhanChiTietInfor>)gPhanCongGiaoNhan.DataSource)
            {
                hd.NhanVienKinhDoanh += String.Format("{0}(Phương tiện: {1})", ct.HoTen, ct.TenPhuongTien) +
                                        (String.IsNullOrEmpty(ct.BienSoXe) ? "" : "/" + ct.BienSoXe) + ";";
            }
            hd.GhiChu = ghichu;
            CommonFuns.Instance.InPhieuGiaoNhan(hd, liHangGiaoNhan, -1);
        }
Exemplo n.º 16
0
        private void LoadData()
        {
            if (frmNV.isAdd)
            {
                btnXoa.Enabled     = false;
                txtMaNhanVien.Text = "";
                txtHoTen.Text      = "";
                //txtNgaySinh.Text = "";
                txtDiaChi.Text      = "";
                txtDienThoai.Text   = "";
                txtEmail.Text       = "";
                txtGhiChu.Text      = "";
                chkSuDung.Checked   = false;
                chkPhuTrach.Checked = false;
                optNam.Checked      = true;
                btnXoa.Enabled      = false;
                gKhoXuat.DataSource = new BindingList <DMKhoCBOLoadInfo>();
            }
            else
            {
                btnXoa.Enabled        = false;
                txtMaNhanVien.Enabled = false;
                dm = DmNhanVienDataProvider.GetListDmNhanVienInfoFromOid(frmNV.Oid);
                txtMaNhanVien.Text = dm.MaNhanVien;
                txtHoTen.Text      = dm.HoTen;
                //tao ma vach tu ma nhan vien
                txtMaVach.Text = String.IsNullOrEmpty(dm.MaVach)
                                     ? GtidCryptionEx.EncryptEx(txtMaNhanVien.Text.Trim(), true)
                                     : dm.MaVach;
                try
                {
                    mstNgaySinh.Value = dm.NgaySinh;
                }
                catch
                {
                    mstNgaySinh.Value = CommonProvider.Instance.GetSysDate();
                }

                txtDiaChi.Text    = dm.DiaChi;
                txtDienThoai.Text = dm.DienThoai;
                txtEmail.Text     = dm.Email;
                txtGhiChu.Text    = dm.GhiChu;

                chkSuDung.Checked         = dm.SuDung == 1;
                chkPhuTrach.Checked       = dm.PhuTrachCSKH == 1;
                optNam.Checked            = dm.GioiTinh == 1;
                optNu.Checked             = dm.GioiTinh == 0;
                cboPhongBan.SelectedValue = Convert.ToInt32(dm.IdPhongBan);
                cboChucVu.SelectedValue   = Convert.ToInt32(dm.IdChucVu);

                LoadQLTrucTiep(dm.IdQuanLyTrucTiep);
                LoadTrungTam(dm.IdTrungTamHachToan);
                LoadKhoXuat(frmNV.Oid);
            }
            if (frmNV.IsSync)
            {
                //không cho phép người dùng sửa, xóa các thông tin trên form.
                txtMaNhanVien.Enabled = false;
                txtHoTen.Enabled      = false;
                btnXoa.Enabled        = false;
            }
        }