public static ErrorComments RetrieveSPComment(string ErrorKey, string CommentType, string Date)
        {
            var tempcomment = new ErrorComments();
            var csql        = "select ErrorKey,Comment,Reporter,CommentDate,CommentType,APVal2 from ErrorComments  where ErrorKey='<ErrorKey>' and CommentType='<CommentType>' and CommentDate='<CommentDate>'";

            csql = csql.Replace("<ErrorKey>", ErrorKey).Replace("<CommentType>", CommentType).Replace("<CommentDate>", Date);
            var cdbret = DBUtility.ExeLocalSqlWithRes(csql, null);

            foreach (var r in cdbret)
            {
                tempcomment.ErrorKey     = Convert.ToString(r[0]);
                tempcomment.dbComment    = Convert.ToString(r[1]);
                tempcomment.Reporter     = Convert.ToString(r[2]);
                tempcomment.CommentDate  = DateTime.Parse(Convert.ToString(r[3]));
                tempcomment.CommentType  = Convert.ToString(r[4]);
                tempcomment.ResultClosed = Convert.ToString(r[5]);
            }

            return(tempcomment);
        }
        public static List <ErrorComments> RetrieveErrorComments(string errorkey, Controller ctrl)
        {
            var ret = new List <ErrorComments>();
            var sql = "select ErrorKey,Comment,Reporter,CommentDate,CommentType,APVal2 from ErrorComments where ErrorKey = '<ErrorKey>' and APVal1 <> 'delete' order by CommentDate ASC";

            sql = sql.Replace("<ErrorKey>", errorkey);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var r in dbret)
            {
                var tempcomment = new ErrorComments();
                tempcomment.ErrorKey     = Convert.ToString(r[0]);
                tempcomment.dbComment    = Convert.ToString(r[1]);
                tempcomment.Reporter     = Convert.ToString(r[2]);
                tempcomment.CommentDate  = DateTime.Parse(Convert.ToString(r[3]));
                tempcomment.CommentType  = Convert.ToString(r[4]);
                tempcomment.ResultClosed = Convert.ToString(r[5]);
                ret.Add(tempcomment);
            }

            return(RepairBase64Image4IE(ret, ctrl));
        }