private void detach_BanHang_LoaiTiens(BanHang_LoaiTien entity) { this.SendPropertyChanging(); entity.BanHang = null; }
partial void DeleteBanHang_LoaiTien(BanHang_LoaiTien instance);
partial void UpdateBanHang_LoaiTien(BanHang_LoaiTien instance);
partial void InsertBanHang_LoaiTien(BanHang_LoaiTien instance);
private void attach_BanHang_LoaiTiens(BanHang_LoaiTien entity) { this.SendPropertyChanging(); entity.LoaiTien = this; }
private bool UpdateDataBanHangLoaiTien(DTO.BanHang dataBanHang) { for (int i = 0; i < dgvLoaiTien.Rows.Count - 1; i++) { if (!string.IsNullOrEmpty(dgvLoaiTien[colIdTien.Name, i].Value.ToString())) { DTO.BanHang_LoaiTien data = BanHang_LoaiTienBus.GetById(ConvertUtil.ConvertToInt(dgvLoaiTien[colIdTien.Name, i].Value)); data.SoLuong = ConvertUtil.ConvertToInt(dgvLoaiTien[colSoLuong.Name, i].Value); data.ThanhTien = ConvertUtil.ConvertToInt(dgvLoaiTien[colThanhTienTien.Name, i].Value.ToString().Replace(Constant.SYMBOL_LINK_MONEY, string.Empty)); if (!BanHang_LoaiTienBus.Update(data)) { return false; } } else { DTO.BanHang_LoaiTien data = new DTO.BanHang_LoaiTien(); data.IdBanHang = dataBanHang.Id; data.IdLoaiTien = ConvertUtil.ConvertToInt(dgvLoaiTien[colIdLoaiTien.Name, i].Value); data.SoLuong = ConvertUtil.ConvertToInt(dgvLoaiTien[colSoLuong.Name, i].Value); data.ThanhTien = ConvertUtil.ConvertToInt(dgvLoaiTien[colThanhTienTien.Name, i].Value.ToString().Replace(Constant.SYMBOL_LINK_MONEY, string.Empty)); if (!BanHang_LoaiTienBus.Insert(data)) { return false; } else { dgvLoaiTien[colIdTien.Name, i].Value = data.Id; } } } return true; }