Пример #1
0
        private void grvDanhSach_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                if (grvDanhSach.FocusedRowHandle < 0)
                {
                    return;
                }
                ChungTuXuatTieuHaoInfornew item = (ChungTuXuatTieuHaoInfornew)grvDanhSach.GetFocusedRow();
                if (item == null)
                {
                    return;
                }
                frm_PhieuNhapTieuHao frm = new frm_PhieuNhapTieuHao(item.IdChungTu, item.SoChungTu, item.NgayXuatHang.ToString(),
                                                                    item.SoChungTuGoc, item.IdChungTuGoc, item.TrangThai, item.HoTen, item.TenTrungTam, item.TenKho, item.NguoiXuat,
                                                                    item.GhiChu, item.IdNhanVienGiao, item.NgayLap.ToString(), item.IdKho);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    liDM = NhapTieuHaoProvider.GetListXuatTieuHao();
                    grcDanhSach.DataSource = liDM;
                }
            }
            catch (Exception ex)
            {
#if DEBUG
                MessageBox.Show(ex.ToString(), Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error);
#else
                MessageBox.Show(ex.Message, Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error);
#endif
                EventLogProvider.Instance.WriteLog(ex.ToString()
                                                   + "\nUser: "******"\nKho: " + Declare.IdKho,
                                                   this.Name);
            }
        }
        public frm_PhieuXuatTieuHaoNew(int oid, string sochungtu, string ngayxuat, string sopo, int idChungTuGoc, int trangThai, string nguoiLap, string TenTrungTam, string TenKho, string NguoiXuat, string GhiChu, int IdNhanVienGiao, string ngayLap, int idKho)
        {
            InitializeComponent();
            this.OID            = oid;
            this.TenTrungTam    = TenTrungTam;
            this.TenKho         = TenKho;
            this.SoChungTu      = sochungtu;
            this.NgayXuat       = ngayxuat;
            this.idChungTuGoc   = idChungTuGoc;
            this.trangThai      = trangThai;
            this.NguoiLap       = nguoiLap;
            this.NguoiXuat      = NguoiXuat;
            this.GhiChu         = GhiChu;
            this.IdNhanVienGiao = IdNhanVienGiao;
            this.NgayLap        = ngayLap;
            this.IdKho          = idKho;
            ChungTuXuatTieuHaoInfornew chungTuXuatTieuHaoInfor =
                XuatTieuHaoProvidernew.Instance.GetChungTuBySoChungTu <ChungTuXuatTieuHaoInfornew>(sochungtu);

            if (chungTuXuatTieuHaoInfor != null)
            {
                chungTuXuatTieuHaoInfor.LoaiChungTu = Convert.ToInt32(TransactionType.XUAT_HUY_TIEU_HAO);
                business = new XuatKhoTieuHaoBusinessnew(chungTuXuatTieuHaoInfor);
            }
        }
Пример #3
0
 public void Update(ChungTuXuatTieuHaoInfornew chungTuXuatTieuHaoInfor)
 {
     ExecUpdateCommand(Declare.StoreProcedureNamespace.spChungTuXTHUpdate, chungTuXuatTieuHaoInfor.IdChungTu,
                       chungTuXuatTieuHaoInfor.SoChungTu,
                       chungTuXuatTieuHaoInfor.IdKho,
                       chungTuXuatTieuHaoInfor.IdNhanVienGiao,
                       chungTuXuatTieuHaoInfor.LoaiChungTu,
                       chungTuXuatTieuHaoInfor.NgayLap,
                       chungTuXuatTieuHaoInfor.TrangThai);
 }
Пример #4
0
 public int Insert(ChungTuXuatTieuHaoInfornew chungTuXuatTieuHaoInfor)
 {
     ExecInsertCommand(Declare.StoreProcedureNamespace.spChungTuDNXTHInsert, chungTuXuatTieuHaoInfor.IdChungTu,
                       chungTuXuatTieuHaoInfor.SoChungTu,
                       chungTuXuatTieuHaoInfor.IdKho,
                       chungTuXuatTieuHaoInfor.IdNhanVienGiao,
                       chungTuXuatTieuHaoInfor.LoaiChungTu,
                       chungTuXuatTieuHaoInfor.NgayLap,
                       chungTuXuatTieuHaoInfor.TrangThai,
                       chungTuXuatTieuHaoInfor.IdPhongBan,
                       chungTuXuatTieuHaoInfor.IdChiPhi);
     return(Convert.ToInt32(Parameters["p_IdChungTu"].Value.ToString()));
 }
Пример #5
0
        public frm_PhieuNhapTieuHao(int oid, string sochungtu, string ngaylap, string sopo)
        {
            InitializeComponent();
            ChungTuXuatTieuHaoInfornew chungTuXuatTieuHaoInfor =
                XuatTieuHaoProvider.Instance.GetChungTuBySoChungTu <ChungTuXuatTieuHaoInfornew>(sochungtu);

            if (chungTuXuatTieuHaoInfor != null)
            {
                chungTuXuatTieuHaoInfor.LoaiChungTu = Convert.ToInt32(TransactionType.NHAP_TIEU_HAO);
                business = new NhapKhoTieuHaoBusiness(chungTuXuatTieuHaoInfor);
            }
            else
            {
                throw new ManagedException(String.Format("Chứng từ số {0} không tồn tại.", sochungtu));
            }
        }
Пример #6
0
        private void btnMoPhieu_Click(object sender, EventArgs e)
        {
            if (grvDanhSach.FocusedRowHandle < 0)
            {
                return;
            }
            ChungTuXuatTieuHaoInfornew item = (ChungTuXuatTieuHaoInfornew)grvDanhSach.GetFocusedRow();
            frm_PhieuNhapTieuHao       frm  = new frm_PhieuNhapTieuHao(item.IdChungTu, item.SoChungTu, item.NgayXuatHang.ToString(),
                                                                       item.SoChungTuGoc, item.IdChungTuGoc, item.TrangThai, item.HoTen, item.TenTrungTam, item.TenKho, item.NguoiXuat,
                                                                       item.GhiChu, item.IdNhanVienGiao, item.NgayLap.ToString(), item.IdKho);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                liDM = NhapTieuHaoProvider.GetListXuatTieuHao();
                grcDanhSach.DataSource = liDM;
            }
        }
        private bool Check()
        {
            if (Equals(bteTVX.Tag, null))
            {
                throw new ManagedException("Bạn chưa chọn thương viên xuất!");
            }
            //foreach (ChungTu_ChiTietInfonew pt in business.ListChiTietChungTu)
            //{
            //    if (pt.IdSanPham == 0)
            //    {
            //        throw new InvalidOperationException("Trong danh sách có sản phẩm bạn chưa thêm vào!");
            //    }
            //}
            int SumChiTietMaVach  = 0;
            int SumChiTietChungTu = 0;

            foreach (ChungTu_ChiTietHangHoaXTHInfo chungTuChiTietHangHoaBaseInfo in business.ListChiTietHangHoa)
            {
                SumChiTietMaVach += chungTuChiTietHangHoaBaseInfo.SoLuong;
            }
            foreach (ChungTu_ChiTietInfonew chungTuChiTietInfo in business.ListChiTietChungTu)
            {
                SumChiTietChungTu += chungTuChiTietInfo.SoLuong;
            }
            if (SumChiTietChungTu > SumChiTietMaVach)
            {
                throw new ManagedException("Bạn chưa nhập đủ số mã vạch!");
            }
            ChungTuXuatTieuHaoInfornew chungTuXuatTieuHaoInfor =
                XuatTieuHaoProvidernew.Instance.GetChungTuBySoChungTu <ChungTuXuatTieuHaoInfornew>(SoChungTu);

            if (chungTuXuatTieuHaoInfor.TrangThai == Convert.ToInt32(TrangThaiDuyet.HUY_TIEU_HAO))
            {
                throw new ManagedException("Kế toán đã hủy phiếu này, bạn không thể xuất được nữa!");
            }
            return(true);
        }