Exemple #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);
        }
        public decimal ThanhTien_ThPh()
        {
            if (View.IdThanhPhamChon <= 0)
            {
                return(0);
            }

            decimal result = 0;


            var canGap    = CanGap.DocTheoId(View.IdThanhPhamChon);
            var tyLeMK    = this.TyLeMarkUp();
            var giaCanGap = new GiaCanGap(View.SoLuong, View.SoDuongCan, tyLeMK, View.DonViTinh, canGap);

            result = giaCanGap.ThanhTienSales();
            return(result);
        }