Example #1
0
        private decimal GiaThPhamTheoSLuong(int soLuong)
        {
            decimal ketQua      = 0;
            var     iDThanhPham = MonThanhPham.DocDVThanhPhamTheoId(View.IdMonThanhPham).ID_DV;
            var     LoaiTP      = MonThanhPham.DocDVThanhPhamTheoId(View.IdMonThanhPham).LoaiThPham;

            switch (LoaiTP)
            {
            case LoaiThanhPhamS.CanPhu:     //Tính theo A4 vậy
                var giaCanPhu = new GiaCanPhu(soLuong, 32, 22, 1, TiLeMarkUpTheoHangKH(), CanPhu.DocTheoId(iDThanhPham));
                ketQua = giaCanPhu.ThanhTienSales();
                break;

            case LoaiThanhPhamS.CanGap:
                //Làm tạm 2 đường
                var giaCanGap = new GiaCanGap(soLuong, 2, TiLeMarkUpTheoHangKH(), View.DonViTinh, CanGap.DocTheoId(iDThanhPham));
                ketQua = giaCanGap.ThanhTienSales();
                break;

            case LoaiThanhPhamS.DongCuon:
                var giaDongCuon = new GiaDongCuon(soLuong, TiLeMarkUpTheoHangKH(), View.DonViTinh, DongCuon.DocTheoId(iDThanhPham));
                ketQua = giaDongCuon.ThanhTienSales();
                break;

            case LoaiThanhPhamS.EpKim:
                //var giaEpKim = new GiaEpKim(soLuong, 5,5, 10, CanPhu.DocTheoId(iDThanhPham));
                ketQua = 0;
                break;
            }
            return(ketQua);
        }
Example #2
0
        public decimal ThanhTien_ThPh()
        {
            decimal result = 0;

            if (View.IdBaiIn <= 0 || View.SoLuong <= 0 || View.IdThanhPhamChon <= 0)
            {
                return(result);
            }
            //Qua khỏi
            var canPhu = CanPhu.DocTheoId(View.IdThanhPhamChon);

            var tyLeMK = this.TyLeMarkUp();

            var giaCanPhu = new GiaCanPhu(View.SoLuong, View.ToChayRong,
                                          View.ToChayDai, View.SoMatCan,
                                          this.TyLeMarkUp(), canPhu);

            result = giaCanPhu.ThanhTienSales();

            return(result);
        }