Exemplo n.º 1
0
        public void Luu(ref string thongDiep)
        {
            CanPhu canPhu = new CanPhu();

            canPhu.ID                = View.ID;
            canPhu.Ten               = View.Ten;
            canPhu.BHR               = View.BHR;
            canPhu.DonViTinh         = View.DonViTinh;
            canPhu.TocDoMetGio       = View.TocDo;
            canPhu.PhiNgVLM2         = View.PhiNguyenVatLieuM2;
            canPhu.ThoiGianChuanBi   = View.ThoiGianChuanBi;
            canPhu.DaySoLuong        = View.DaySoLuongCoBan;
            canPhu.DayLoiNhuan       = View.DayLoiNhuanCoBan;
            canPhu.DaySoLuongNiemYet = View.DaySoLuongNiemYet;
            canPhu.ThuTu             = View.ThuTu;

            switch (View.TinhTrangForm)
            {
            case FormStateS.Edit:
                thongDiep = CanPhu.Sua(canPhu);
                break;

                /*case TinhGiaInClient.FormStateS.New:
                 *  thongDiep = BangGiaInNhanh.Them(canPhu);
                 *  break;
                 */
            }
        }
Exemplo n.º 2
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 Dictionary <int, string> CanPhuS()
        {
            Dictionary <int, string> dict = new Dictionary <int, string>();

            foreach (CanPhu cp in CanPhu.DocTatCa())
            {
                dict.Add(cp.ID, cp.Ten);
            }
            return(dict);
        }
        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);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
        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;
        }
Exemplo n.º 7
0
 //Dành cho display
 public List <CanPhu> ThanhPhamS()
 {
     return(CanPhu.DocTatCa());
 }
Exemplo n.º 8
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);
        }