Beispiel #1
0
		private void detach_BanHang_LoaiTiens(BanHang_LoaiTien entity)
		{
			this.SendPropertyChanging();
			entity.BanHang = null;
		}
Beispiel #2
0
 partial void DeleteBanHang_LoaiTien(BanHang_LoaiTien instance);
Beispiel #3
0
 partial void UpdateBanHang_LoaiTien(BanHang_LoaiTien instance);
Beispiel #4
0
 partial void InsertBanHang_LoaiTien(BanHang_LoaiTien instance);
Beispiel #5
0
		private void attach_BanHang_LoaiTiens(BanHang_LoaiTien entity)
		{
			this.SendPropertyChanging();
			entity.LoaiTien = this;
		}
Beispiel #6
0
        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;
        }