コード例 #1
0
        /// <summary>
        /// 删除主题测试单元关联表
        /// </summary>
        /// <param name="unitid">测试单元ID数组,如果传入NULL则删除全部关联</param>
        /// <param name="themeid">主题ID</param>
        /// <returns></returns>
        public static bool DelGuanLianUnit(string[] unitid, string themeid)
        {
            string sql = "delete from testunittheme where 1 = 1 ";

            if (themeid != null)
            {
                sql += "and themeid='" + themeid + "'";
            }
            string unitstr = "";

            if (unitid == null)
            {
                unitstr = "0";
            }
            else
            {
                for (int i = 0; i < unitid.Length; i++)
                {
                    unitstr = "'" + unitid[i] + "'," + unitstr;
                }
                unitstr = unitstr.Substring(0, unitstr.Length - 1);
                sql    += " and unitid in (" + unitstr + ") ";
            }
            try {
                SqlDBUtil.ExecuteNonQuery(sql);
                return(true);
            } catch (Exception) {
                throw new Exception("删除id数据出现异常");
                return(false);
            }
        }
コード例 #2
0
        public static bool DeleteTheme(string themeid)
        {
            string sql = "delete from testtheme where id='" + themeid + "' or parentid ='" + themeid + "'";

            try {
                SqlDBUtil.ExecuteNonQuery(sql);
                return(true);
            } catch (Exception) {
                throw new Exception("删除出现异常");
                return(false);
            }
        }
コード例 #3
0
ファイル: UICheckDao.cs プロジェクト: wellbeing2014/mywatcher
        static public bool DelUICheckViewByNO(string checkno)
        {
            string sql = "delete from UICheckView where checkno='" + checkno + "'";

            try {
                SqlDBUtil.ExecuteNonQuery(sql);
                return(true);
            } catch (Exception) {
                throw new Exception("删除出现异常");
                return(false);
            }
        }
コード例 #4
0
ファイル: UICheckDao.cs プロジェクト: wellbeing2014/mywatcher
        static public bool DelUICheckViewByImageno(string checkno, string imageno)
        {
            string sql = "delete from UICheckView where checkno='" + checkno +
                         "' and imageno='" + imageno + "'";

            try {
                SqlDBUtil.ExecuteNonQuery(sql);
                return(true);
            } catch (Exception e) {
                throw new Exception("删除出现异常" + e.ToString());
                return(false);
            }
        }
コード例 #5
0
ファイル: UICheckDao.cs プロジェクト: wellbeing2014/mywatcher
        static public bool UpdateState(string state, string checkedtime, string checkername, string checkerid, string id)
        {
            bool   isSuccess = false;
            string sql       = "update uicheckinfo set state='" + state + "',checkedtime='" + checkedtime + "',checkername='" + checkername + "',checkerid=" + checkerid + " where id=" + id;

            try {
                SqlDBUtil.ExecuteNonQuery(sql);
                isSuccess = true;
            } catch (Exception) {
                isSuccess = false;
            }
            return(isSuccess);
        }
コード例 #6
0
        static public bool UpdateState(string state, string id)
        {
            bool   isSuccess = false;
            string sql       = "update testunit set state='" + state + "' where id=" + id;

            try {
                SqlDBUtil.ExecuteNonQuery(sql);
                isSuccess = true;
            } catch (Exception) {
                isSuccess = false;
            }
            return(isSuccess);
        }
コード例 #7
0
        public static bool updateForPub(string id, string pubpath)
        {
            string time = System.DateTime.Now.ToLocalTime().ToString();
            string sql  = "update packageinfo set pubpath = '" + pubpath + "',publishtime ='" + time + "',state ='已发布' where id=" + id;

            try {
                int i = SqlDBUtil.ExecuteNonQuery(sql);
                if (i != 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            } catch (Exception) {
                return(false);
            }
        }