예제 #1
0
 /// <summary>
 /// 添加BookFromCountry表行数据(如主键为非自增型字段,则自行修改代码)
 /// </summary>
 /// <param name="bookfromcountrydata">数据集对象</param>
 /// <param name="bookfromcountry">实体对象</param>
 public void AddRow(ref BookFromCountryData bookfromcountrydata, EntityBookFromCountry bookfromcountry)
 {
     #region
     DataRow dr = bookfromcountrydata.Tables[0].NewRow();
     bookfromcountrydata.Assign(dr, BookFromCountryData.countryId, bookfromcountry.countryId);
     bookfromcountrydata.Assign(dr, BookFromCountryData.countryName, bookfromcountry.countryName);
     bookfromcountrydata.Assign(dr, BookFromCountryData.usable, bookfromcountry.usable);
     bookfromcountrydata.Assign(dr, BookFromCountryData.sort, bookfromcountry.sort);
     bookfromcountrydata.Tables[0].Rows.Add(dr);
     #endregion
 }
예제 #2
0
 /// <summary>
 /// 编辑bookfromcountrydata数据集中指定的行数据
 /// </summary>
 /// <param name="bookfromcountrydata">数据集对象</param>
 /// <param name="bookfromcountry">实体对象</param>
 public void EditRow(ref BookFromCountryData bookfromcountrydata, EntityBookFromCountry bookfromcountry)
 {
     #region
     if (bookfromcountrydata.Tables[0].Rows.Count <= 0)
     {
         bookfromcountrydata = this.getData(bookfromcountry.countryId);
     }
     DataRow dr = bookfromcountrydata.Tables[0].Rows.Find(new object[1] {
         bookfromcountry.countryId
     });
     bookfromcountrydata.Assign(dr, BookFromCountryData.countryId, bookfromcountry.countryId);
     bookfromcountrydata.Assign(dr, BookFromCountryData.countryName, bookfromcountry.countryName);
     bookfromcountrydata.Assign(dr, BookFromCountryData.usable, bookfromcountry.usable);
     bookfromcountrydata.Assign(dr, BookFromCountryData.sort, bookfromcountry.sort);
     #endregion
 }