/// <summary> /// 添加Group表行数据(如主键为非自增型字段,则自行修改代码) /// </summary> /// <param name="groupdata">数据集对象</param> /// <param name="group">实体对象</param> public void AddRow(ref GroupData groupdata, EntityGroup group) { #region DataRow dr = groupdata.Tables[0].NewRow(); groupdata.Assign(dr, GroupData.gid, group.gid); groupdata.Assign(dr, GroupData.uid, group.uid); groupdata.Assign(dr, GroupData.groupName, group.groupName); groupdata.Assign(dr, GroupData.writeTime, group.writeTime); groupdata.Tables[0].Rows.Add(dr); #endregion }
/// <summary> /// 编辑groupdata数据集中指定的行数据 /// </summary> /// <param name="groupdata">数据集对象</param> /// <param name="group">实体对象</param> public void EditRow(ref GroupData groupdata, EntityGroup group) { #region if (groupdata.Tables[0].Rows.Count <= 0) { groupdata = this.getData(group.gid); } DataRow dr = groupdata.Tables[0].Rows.Find(new object[1] { group.gid }); groupdata.Assign(dr, GroupData.gid, group.gid); groupdata.Assign(dr, GroupData.uid, group.uid); groupdata.Assign(dr, GroupData.groupName, group.groupName); groupdata.Assign(dr, GroupData.writeTime, group.writeTime); #endregion }