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_ThPh() { decimal result = 0; var idEpKim = this.ThanhPhamS().FirstOrDefault(x => x.Value == View.TenThPhChon).Key; var epKim = EpKim.DocTheoId(idEpKim); var khuonEp = KhuonEpKim.DocTheoId(View.IdKhuonChon); NhuEpKim nhuEp = null; nhuEp = NhuEpKim.DocTheoId(View.IdNhuEpKimChon); if (nhuEp == null)//không thể không có nhũ { return(0); } var mucLoiNhuan = TinhToanThanhPham.MucLoiNhuan(epKim.DaySoLuong, epKim.DayLoiNhuan, View.SoLuong); var giaEpKim = new GiaEpKim(View.SoLuong, View.KhoEpRong, View.KhoEpCao, epKim, khuonEp, nhuEp, mucLoiNhuan); decimal tyLeMK = (decimal)this.TyLeMarkUp(View.IdHangKhachHang) / 100; result = giaEpKim.ThanhTienCoBan() + giaEpKim.ThanhTienCoBan() * tyLeMK / (1 - tyLeMK); return(result); }
public bool LaNhuViTinh() { var kq = false; var epKim = EpKim.DocTheoId(View.IdThanhPhamChon); if (epKim != null) { kq = epKim.LaNhuViTinh; } return(kq); }
public bool LaNhuViTinh() { var idEpKim = this.ThanhPhamS().FirstOrDefault(x => x.Value == View.TenThPhChon).Key; var epKim = EpKim.DocTheoId(idEpKim); if (epKim.LaNhuViTinh) { return(true); } else { return(false); } }
public decimal ThanhTien_ThPh() { decimal kq = 0; var epKim = EpKim.DocTheoId(View.IdThanhPhamChon); if (View.IdNhuEpKimChon <= 0) { return(0);//Không thể không có nhũ } var nhuEp = NhuEpKim.DocTheoId(View.IdNhuEpKimChon); //Lưu ý số lượng tính giá var giaEpKim = new GiaEpKim(View.SoLuongTinhGia, View.KhoEpRong, View.KhoEpCao, epKim, nhuEp, this.TyLeMarkUp()); kq = giaEpKim.ThanhTienSales(); return(kq); }
public decimal ThanhTien_ThPh() { decimal result = 0; var idEpKim = this.ThanhPhamS().FirstOrDefault(x => x.Value == View.TenThPhChon).Key; var epKim = EpKim.DocTheoId(idEpKim); var khuonEp = KhuonEpKim.DocTheoId(View.IdKhuonChon); var nhuEp = NhuEpKim.DocTheoId(View.IdNhuEpKimChon); var mucLoiNhuan = TinhToanThanhPham.MucLoiNhuan(epKim.DaySoLuong, epKim.DaySoLuong, View.SoLuong); var giaEpKim = new GiaEpKim(View.SoLuong, View.KhoEpRong, View.KhoEpCao, epKim, nhuEp, mucLoiNhuan); var idCanPhu = this.ThanhPhamS().FirstOrDefault(x => x.Value == View.TenThPhChon).Key; var epKim = EpKim.DocTheoId(idCanPhu); decimal tyLeMK = (decimal)this.TyLeMarkUp(View.IdHangKhachHang) / 100; result = epKim.ThanhTienCoBan(View.SoLuong) + epKim.ThanhTienCoBan(View.SoLuong) * tyLeMK / (1 - tyLeMK); return(result); }
public void TrinhBayChiTietMayIn() { if (View.ID <= 0) { return; } var epKim = EpKim.DocTheoId(View.ID); View.ID = epKim.ID; View.Ten = epKim.Ten; View.BHR = epKim.BHR; View.DonViTinh = epKim.DonViTinh; View.TocDo = epKim.TocDoConGio; View.ThoiGianChuanBi = epKim.ThoiGianChuanBi; View.PhiNguyenVatLieuChuanBi = epKim.PhiNVLChuanBi; View.GiaKhuonCM2 = epKim.GiaKhuonCm2; View.LaNhuViTinh = epKim.LaNhuViTinh; View.DaySoLuongCoBan = epKim.DaySoLuong; View.DayLoiNhuanCoBan = epKim.DayLoiNhuan; View.DaySoLuongNiemYet = epKim.DaySoLuongNiemYet; View.ThuTu = epKim.ThuTu; }