/// <summary>
        ///根据SQL语句获取集合
        /// </summary>
        private IList <Tbl_DesignVersion> getTbl_DesignVersionsBySql(string sql)
        {
            IList <Tbl_DesignVersion> list = new List <Tbl_DesignVersion>();
            DataSet ds = DBHelper.ExecuteDataset(this.connection, CommandType.Text, sql);

            if (ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                foreach (DataRow dr in dt.Rows)
                {
                    Tbl_DesignVersion tbl_designversion = new Tbl_DesignVersion();
                    tbl_designversion.ID           = Convert.ToInt32(dr["ID"]);
                    tbl_designversion.UserName     = Convert.ToString(dr["UserName"]);
                    tbl_designversion.DesignTaskID = Convert.ToInt32(dr["DesignTaskID"]);
                    tbl_designversion.CadFile      = Convert.ToString(dr["CadFile"]);
                    tbl_designversion.Remark       = Convert.ToString(dr["Remark"]);
                    tbl_designversion.DealFlag     = Convert.ToInt32(dr["DealFlag"]);
                    tbl_designversion.DealTime     = Convert.ToDateTime(dr["DealTime"]);
                    tbl_designversion.DealUser     = Convert.ToString(dr["DealUser"]);
                    tbl_designversion.AddDate      = Convert.ToDateTime(dr["AddDate"]);
                    list.Add(tbl_designversion);
                }
            }
            return(list);
        }
 public static int UpdateTbl_DesignVersion(Tbl_DesignVersion tbl_designversion)
 {
     WebCommon.Public.WriteLog("修改设计版本:" + tbl_designversion.DesignTaskID);
     tbl_designversion.DealUser = WebCommon.Public.GetUserName();
     tbl_designversion.DealTime = DateTime.Now;
     return(new Tbl_DesignVersionService().UpdateTbl_DesignVersionById(tbl_designversion));
 }
        public int AddTbl_DesignVersion(Tbl_DesignVersion tbl_designversion)
        {
            string sql = "insert into [Tbl_DesignVersion] ([UserName],[DesignTaskID],[CadFile],[Remark],[DealUser]) values (@UserName,@DesignTaskID,@CadFile,@Remark,@DealUser)";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@UserName", tbl_designversion.UserName),
                new SqlParameter("@DesignTaskID", tbl_designversion.DesignTaskID),
                new SqlParameter("@CadFile", tbl_designversion.CadFile),
                new SqlParameter("@Remark", tbl_designversion.Remark),
                new SqlParameter("@DealUser", tbl_designversion.DealUser)
            };
            return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp));
        }
        public int UpdateTbl_DesignVersionById(Tbl_DesignVersion tbl_designversion)
        {
            string sql = "update [Tbl_DesignVersion] set [UserName]=@UserName,[DesignTaskID]=@DesignTaskID,[CadFile]=@CadFile,[Remark]=@Remark,[DealUser]=@DealUser where DealFlag=0 and [ID]=@ID";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@ID", tbl_designversion.ID),
                new SqlParameter("@UserName", tbl_designversion.UserName),
                new SqlParameter("@DesignTaskID", tbl_designversion.DesignTaskID),
                new SqlParameter("@CadFile", tbl_designversion.CadFile),
                new SqlParameter("@Remark", tbl_designversion.Remark),
                new SqlParameter("@DealUser", tbl_designversion.DealUser)
            };
            return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp));
        }
 public static int AddTbl_DesignVersion(Tbl_DesignVersion tbl_designversion)
 {
     WebCommon.Public.WriteLog("添加设计版本:" + tbl_designversion.DesignTaskID);
     return(new Tbl_DesignVersionService().AddTbl_DesignVersion(tbl_designversion));
 }