public void SetDb(Context.DataBox dbitem) { dbitem.Id = Id; dbitem.NoBox = NoBox; dbitem.IdDataTruck = IdDataTruck; dbitem.Karoseri = Karoseri; dbitem.Tahun = Tahun; dbitem.IdType = IdType; dbitem.IdKategori = IdKategori; dbitem.Lantai = Lantai; dbitem.Dinding = Dinding; dbitem.PintuSamping = PintuSamping; dbitem.Sekat = Sekat; dbitem.garansiStr = garansiStr; dbitem.garansiEnd = garansiEnd; dbitem.asuransiStr = asuransiStr; dbitem.asuransiEnd = asuransiEnd; dbitem.tglPasang = tglPasang; dbitem.DataBoxLantai.Clear(); dbitem.DataBoxDinding.Clear(); if (ListLantai.Count() > 0) { foreach (LantaiModel item in ListLantai) { if (item.IsSelect) { dbitem.DataBoxLantai.Add(new DataBoxLantai() { IdLantaiCode = item.IdLantai }); } } } if (ListDinding.Count() > 0) { foreach (DindingModel item in ListDinding) { if (item.IsSelect) { dbitem.DataBoxDinding.Add(new DataBoxDinding() { IdDindingCode = item.IdDinding }); } } } }
public void SetDbTruckHistory(Context.DataTruckBoxHistory dbitem, string user) { dbitem.NoBox = NoBox; dbitem.Vehicle = VehicleNo; dbitem.Karoseri = Karoseri; dbitem.Tahun = Tahun; dbitem.strType = StrType; dbitem.strKategori = StrKategori; dbitem.Lantai = Lantai; dbitem.Dinding = Dinding; dbitem.PintuSamping = PintuSamping; dbitem.Sekat = Sekat; dbitem.garansiStr = garansiStr; dbitem.garansiEnd = garansiEnd; dbitem.asuransiStr = asuransiStr; dbitem.asuransiEnd = asuransiEnd; dbitem.tglPasang = tglPasang; dbitem.Tanggal = DateTime.Now; dbitem.username = user; if (ListLantai.Count() > 0) { foreach (LantaiModel item in ListLantai) { if (item.IsSelect) { dbitem.Lantai = dbitem.Lantai + ", " + item.StrLantai; } } } if (ListDinding.Count() > 0) { foreach (DindingModel item in ListDinding) { if (item.IsSelect) { dbitem.Dinding = dbitem.Dinding + ", " + item.StrDinding; } } } }