Exemplo n.º 1
0
        public static string CommentFiles(int R)
        {//select * from REQUEST_COMMENT where REQUEST_ID=@r
            DataTable dt = Mydb.ExecuteReadertoDataTable("select * from REQUEST_COMMENT_SUPPLIERS where REQUEST_ID=@r  and COMMENT_FILE is not null", new SqlParameter[] { new SqlParameter("@r", R) }, CommandType.Text);
            List <REQUEST_COMMENT> rcs = new List <REQUEST_COMMENT>();

            foreach (DataRow item in dt.Rows)
            {
                REQUEST_COMMENT rc = new REQUEST_COMMENT();
                rc.COMMENT_FILE = item["COMMENT_FILE"].ToString();
                rcs.Add(rc);
            }
            JavaScriptSerializer js = new JavaScriptSerializer();

            return(js.Serialize(rcs));
        }
Exemplo n.º 2
0
        public static string GetCommentsById(int rid)
        {
            DataTable dt = Mydb.ExecuteReadertoDataTable("select * from REQUEST_COMMENT_SUPPLIERS where REQUEST_ID=@rid order by COMENT_ID asc", new SqlParameter[] { new SqlParameter("@rid", rid) }, CommandType.Text);
            List <REQUEST_COMMENT> rcs = new List <REQUEST_COMMENT>();

            foreach (DataRow item in dt.Rows)
            {
                REQUEST_COMMENT rc = new REQUEST_COMMENT();
                rc.COMMENT_FILE     = item["COMMENT_FILE"].ToString();
                rc.REQUEST_COMMENT_ = item["REQUEST_COMMENT"].ToString();
                rc.COMMENT_DATETIME = item["COMMENT_DATETIME"].ToString();
                rc.H_COMMNET_FILE   = item["H_COMMNET_FILE"].ToString();
                rcs.Add(rc);
            }
            JavaScriptSerializer js = new JavaScriptSerializer();

            return(js.Serialize(rcs));
        }