Esempio n. 1
0
        public string LuuDaySoLuong()
        {
            var mg          = "";
            var iDThanhPham = MonThanhPham.DocDVThanhPhamTheoId(View.IdMonThanhPham).ID_DV;
            var LoaiTP      = MonThanhPham.DocDVThanhPhamTheoId(View.IdMonThanhPham).LoaiThPham;

            switch (LoaiTP)
            {
            case LoaiThanhPhamS.CanPhu:
                var canPhu = CanPhu.DocTheoId(iDThanhPham);
                canPhu.DaySoLuongNiemYet = View.DaySoluong;
                mg = CanPhu.Sua(canPhu);
                break;

            case LoaiThanhPhamS.CanGap:
                var canGap = CanGap.DocTheoId(iDThanhPham);
                canGap.DaySoLuongNiemYet = View.DaySoluong;
                mg = CanGap.Sua(canGap);
                break;

            case LoaiThanhPhamS.DongCuon:
                var dongCuon = DongCuon.DocTheoId(iDThanhPham);
                dongCuon.DaySoLuongNiemYet = View.DaySoluong;
                mg = DongCuon.Sua(dongCuon);
                break;

            case LoaiThanhPhamS.EpKim:
                var epKim = EpKim.DocTheoId(iDThanhPham);
                epKim.DaySoLuongNiemYet = View.DaySoluong;
                mg = EpKim.Sua(epKim);
                break;
            }
            return(mg);
        }
        public decimal ThanhTien_CanPhu(string tenCanPhu)
        {
            decimal result   = 0;
            var     idCanPhu = this.CanPhuS().FirstOrDefault(x => x.Value == tenCanPhu).Key;
            var     canPhu   = CanPhu.DocTheoId(idCanPhu);
            decimal tyLeMK   = this.TyLeMarkUp(View.IdHangKhachHang) / 100;

            result = canPhu.ThanhTienCoBan(View.SoLuongA4CanPhu) +
                     canPhu.ThanhTienCoBan(View.SoLuongA4CanPhu) * tyLeMK / (1 - tyLeMK);

            return(result);
        }
Esempio n. 3
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);
        }
        public void TrinhBayChiTietMayIn()
        {
            if (View.ID <= 0)
            {
                return;
            }

            var canPhu = CanPhu.DocTheoId(View.ID);

            View.ID                 = canPhu.ID;
            View.Ten                = canPhu.Ten;
            View.BHR                = canPhu.BHR;
            View.DonViTinh          = canPhu.DonViTinh;
            View.TocDo              = canPhu.TocDoMetGio;
            View.ThoiGianChuanBi    = canPhu.ThoiGianChuanBi;
            View.PhiNguyenVatLieuM2 = canPhu.PhiNgVLM2;
            View.DaySoLuongCoBan    = canPhu.DaySoLuong;
            View.DayLoiNhuanCoBan   = canPhu.DayLoiNhuan;
            View.DaySoLuongNiemYet  = canPhu.DaySoLuongNiemYet;
            View.ThuTu              = canPhu.ThuTu;
        }
Esempio n. 5
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);
        }