/// <summary>
 /// 用于向 vUTPCommand EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddTovUTPCommand(vUTPCommand vUTPCommand)
 {
     base.AddObject("vUTPCommand", vUTPCommand);
 }
 /// <summary>
 /// 创建新的 vUTPCommand 对象。
 /// </summary>
 /// <param name="commandID">CommandID 属性的初始值。</param>
 /// <param name="sequence">Sequence 属性的初始值。</param>
 /// <param name="commandLine">CommandLine 属性的初始值。</param>
 /// <param name="relateID">RelateID 属性的初始值。</param>
 public static vUTPCommand CreatevUTPCommand(global::System.String commandID, global::System.Int32 sequence, global::System.String commandLine, global::System.String relateID)
 {
     vUTPCommand vUTPCommand = new vUTPCommand();
     vUTPCommand.CommandID = commandID;
     vUTPCommand.Sequence = sequence;
     vUTPCommand.CommandLine = commandLine;
     vUTPCommand.RelateID = relateID;
     return vUTPCommand;
 }
Exemplo n.º 3
0
        public void InsertCommand(UTPCommandBuilder builder, string RelateID)
        {
            ServiceDirectDBEntities objDB;
            vUTPCommand vUTPCommandObj;

            //影响行数标记
            int counts = 0;

            //插入数据
            try
            {
                objDB = new ServiceDirectDBEntities();
                vUTPCommandObj = new vUTPCommand();
                vUTPCommandObj.CommandID = builder.CommandID;
                vUTPCommandObj.CommandLine = builder.CommandString;
                vUTPCommandObj.RelateID = RelateID;
                vUTPCommandObj.Sequence = 1;
                objDB.vUTPCommand.AddObject(vUTPCommandObj);
                counts = objDB.SaveChanges();
            }
            catch (EntitySqlException)
            {
                throw;
            }
        }