Ejemplo n.º 1
0
 /// <summary>
 /// 编辑computerdata数据集中指定的行数据
 /// </summary>
 /// <param name="computerdata">数据集对象</param>
 /// <param name="computer">实体对象</param>
 public void EditRow(ref ComputerData computerdata, EntityComputer computer)
 {
     #region
     if (computerdata.Tables[0].Rows.Count <= 0)
     {
         computerdata = this.getData(computer.computerId);
     }
     DataRow dr = computerdata.Tables[0].Rows.Find(new object[1] {
         computer.computerId
     });
     computerdata.Assign(dr, ComputerData.computerId, computer.computerId);
     computerdata.Assign(dr, ComputerData.userName, computer.userName);
     computerdata.Assign(dr, ComputerData.userIp, computer.userIp);
     computerdata.Assign(dr, ComputerData.MACAddress, computer.MACAddress);
     computerdata.Assign(dr, ComputerData.IpUseStatus, computer.IpUseStatus);
     computerdata.Assign(dr, ComputerData.workStatus, computer.workStatus);
     computerdata.Assign(dr, ComputerData.computerType, computer.computerType);
     computerdata.Assign(dr, ComputerData.writeUser, computer.writeUser);
     computerdata.Assign(dr, ComputerData.writeTime, computer.writeTime);
     computerdata.Assign(dr, ComputerData.writeIp, computer.writeIp);
     computerdata.Assign(dr, ComputerData.remark, computer.remark);
     #endregion
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 添加Computer表行数据(如主键为非自增型字段,则自行修改代码)
 /// </summary>
 /// <param name="computerdata">数据集对象</param>
 /// <param name="computer">实体对象</param>
 public void AddRow(ref ComputerData computerdata, EntityComputer computer)
 {
     #region
     DataRow dr = computerdata.Tables[0].NewRow();
     computerdata.Assign(dr, ComputerData.computerId, computer.computerId);
     computerdata.Assign(dr, ComputerData.userName, computer.userName);
     computerdata.Assign(dr, ComputerData.userIp, computer.userIp);
     computerdata.Assign(dr, ComputerData.MACAddress, computer.MACAddress);
     computerdata.Assign(dr, ComputerData.IpUseStatus, computer.IpUseStatus);
     computerdata.Assign(dr, ComputerData.workStatus, computer.workStatus);
     computerdata.Assign(dr, ComputerData.computerType, computer.computerType);
     computerdata.Assign(dr, ComputerData.writeUser, computer.writeUser);
     computerdata.Assign(dr, ComputerData.writeTime, computer.writeTime);
     computerdata.Assign(dr, ComputerData.writeIp, computer.writeIp);
     computerdata.Assign(dr, ComputerData.remark, computer.remark);
     computerdata.Tables[0].Rows.Add(dr);
     #endregion
 }