Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         string eformsn = Request["eformsn"];
         if (Wis.Toolkit.Validator.IsInt(eformsn))
         {
             Response.Write("<script language='javascript'>alert ('编号错误!');window.close();</script>");
             return;
         }
         Wis.Toolkit.DataProvider dataProvider = new Wis.Toolkit.DataProvider(Website.Setting.MeetingConnectionString);
         dataProvider.Open();
         string commandText = string.Format("Select  * from wd_75 where eformsn = {0}", eformsn);
         System.Data.DataTable dt = dataProvider.ExecuteDataset(commandText).Tables[0];
         if (dt == null)
         {
             Response.Write("<script language='javascript'>alert ('数据不存在!');window.close();</script>");
             return;
         }
         if (dt.Rows[0]["txtTitle"] != null)
             titleId.InnerHtml = dt.Rows[0]["txtTitle"].ToString();
         if (dt.Rows[0]["txtTitle"] != null)
             titleId.InnerHtml = dt.Rows[0]["txtTitle"].ToString();
     }
 }
Exemple #2
0
 /// <summary>
 /// 读取列表数据
 /// </summary>
 /// <returns></returns>
 public static System.Data.DataTable ArticleDt()
 {
     Wis.Toolkit.DataProvider dataProvider = new Wis.Toolkit.DataProvider(Setting.ConnectionString);
     dataProvider.Open();
     try
     {
       System.Data.DataTable dt =  dataProvider.ExecuteDataset(labelEntity.CommandText).Tables[0];
         dataProvider.Close();
         return dt;
     }
     catch
     {
         if(!dataProvider.IsClosed) dataProvider.Close();
         return null;
     }
 }
 string newsstr()
 {
     string ParentId = Request.QueryString["ParentId"];
     string liststr = string.Empty;
     if (string.IsNullOrEmpty(ParentId))
         ParentId = "0";
     Wis.Toolkit.DataProvider dataProvider = new Wis.Toolkit.DataProvider(Website.Setting.ConnectionString);
     dataProvider.Open();
     //Guid parentGuid;
     //if (!Wis.Toolkit.Validator.IsGuid(ParentId))
     //    ParentId = Guid.Empty.ToString();
     string commandText;
     if (ParentId=="0")
         commandText = string.Format("select * from Category where ParentGuid = '{0}' ", Guid.Empty);
     else
        commandText= string.Format("select * from Category where ParentGuid in (select CategoryGuid from Category where CategoryId ={0}) ", ParentId);
     System.Data.DataTable dt  = dataProvider.ExecuteDataset(commandText).Tables[0];
     foreach(System.Data.DataRow drow in dt.Rows)
     {
         commandText = string.Format("select count(CategoryId) from Category where ParentGuid = '{0}'", drow["CategoryGuid"].ToString());
         int o = (int)dataProvider.ExecuteScalar(commandText);
         if (o > 0 )
         {
             liststr += "<div><img src=\"../../sysImages/normal/b.gif\" alt=\"点击展开子栏目\"  border=\"0\" class=\"LableItem\" onClick=\"javascript:SwitchImg(this,'" + drow["CategoryId"] + "');\" />&nbsp;<span id=\"" + drow["CategoryGuid"] + "\" class=\"LableItem\" ondblclick=\"ReturnValue();\" onClick=\"SelectLable(this);sFiles('" + drow["CategoryGuid"] + "','" + drow["CategoryName"] + "');\">" + drow["CategoryName"] + "</span><div id=\"Parent" + drow["CategoryId"] + "\" class=\"SubItem\" HasSub=\"True\" style=\"height:100%;display:none;\"></div></div>";
         }
         else
         {
             liststr += "<div><img src=\"../../sysImages/normal/s.gif\" alt=\"没有子栏目\"  border=\"0\" class=\"LableItem\" />&nbsp;<span id=\"" + drow["CategoryGuid"] + "\" class=\"LableItem\" ondblclick=\"ReturnValue();\" onClick=\"SelectLable(this);sFiles('" + drow["CategoryGuid"] + "','" + drow["CategoryName"] + "');\">" + drow["CategoryName"] + "</span></div>";
         }
     }
     dataProvider.Close();
     if (liststr != string.Empty)
         liststr = "Succee|||" + ParentId + "|||" + liststr;
     else
         liststr = "Fail|||" + ParentId + "|||";
     return liststr;
 }
Exemple #4
0
        public void MeetingInfo(HttpContext context)
        {
            context.Response.ContentType = "text/xml";
            context.Response.ContentEncoding = System.Text.Encoding.UTF8;
            context.Response.Write("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
               string eformsn = context.Request["eformsn"];
            if(!Wis.Toolkit.Validator.IsInt(eformsn))
            {
              context.Response.Write(0);
                return;
            }
            Wis.Toolkit.DataProvider dataProvider = new Wis.Toolkit.DataProvider(Website.Setting.MeetingConnectionString);
            dataProvider.Open();
            string commandText = string.Format("update wd_75 set Hits = Hits + 1 where  eformsn ={0}", eformsn);
            dataProvider.ExecuteNonQuery(commandText);
             commandText = string.Format("select * from wd_75 where eformsn ={0}", eformsn);
            System.Data.DataTable dt = dataProvider.ExecuteDataset(commandText).Tables[0];
            dataProvider.Close();
            if (dt.Rows.Count < 1)
            {
                context.Response.Write(0);
                return;
            }
            using (StringWriter sw = new StringWriter())
            {
                XmlTextWriter xtw = new XmlTextWriter(sw);
                xtw.Formatting = Formatting.Indented;
                // xtw.WriteStartDocument();
                xtw.WriteStartElement("L"); // League -> L
                  xtw.WriteStartElement("A");
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append(dt.Rows[0]["eformsn"].ToString());
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["txtZhuChi"].ToString().Replace(";", ","));//主持人
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["txtEndDate"].ToString() + " " + dt.Rows[0]["txtEndTime"].ToString());//会议结束日期
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["txtRenShu"].ToString().Replace(";", ","));//参会人数
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["txtDate"].ToString() + " " + dt.Rows[0]["txtTime"].ToString());//会议开始日期
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["txtAddress"].ToString().Replace(";", ","));//会议地点
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["txtTitle"].ToString().Replace(";", ","));//会议名称
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["txtshenqingren"].ToString().Replace(";", ","));//申请人
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["deptName"].ToString().Replace(";", ","));//预定部门
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["txtYuHuiRY"].ToString().Replace(";", ","));//与会人员
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["RichTextBox1"].ToString().Replace(";", ","));//内容
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["Hits"].ToString());//浏览次数
                    sb.Append(";"); //
                    sb.Append(dt.Rows[0]["Comments"].ToString());//评论条数
                    sb.Append(";"); //

                    xtw.WriteAttributeString("V", sb.ToString());
                    xtw.WriteEndElement();// ActiveMatch -> A
                     //commandText = string.Format("select * from webflowAttach where eformsn ={0} and eformID =75", eformsn);
                     //System.Data.DataTable dt1 = dataProvider.ExecuteDataset(commandText).Tables[0];
                     //foreach(System.Data.DataRow drow in dt1.Rows)
                     //{
                     //    xtw.WriteStartElement("F");
                     //    System.Text.StringBuilder sb1 = new System.Text.StringBuilder();

                     //    xtw.WriteAttributeString("V", sb1.ToString());
                     //    xtw.WriteEndElement();// ActiveMatch -> A
                     //}

                xtw.WriteEndElement();// Live -> L
                //xtw.WriteEndDocument();
                context.Response.Write(sw.ToString());

            }
        }
Exemple #5
0
        public static bool linkhtml()
        {
            Wis.Toolkit.DataProvider dataProvider = new Wis.Toolkit.DataProvider(Setting.ConnectionString);
            dataProvider.Open();
            string commandtext = string.Format("select * from Category  where CategoryId = 37");
            System.Data.DataTable dt = dataProvider.ExecuteDataset(commandtext).Tables[0];

            tempcontent = ReadHtml(dt.Rows[0]["TemplatePath"].ToString());
            ReplacelistLabels();
            WriteHtmls(tempcontent, System.Web.HttpContext.Current.Request.PhysicalApplicationPath + dt.Rows[0]["ReleasePath"].ToString());
            return true;
        }
Exemple #6
0
        /// <summary>
        /// 生成关联页面
        /// </summary>
        /// <param name="categoryId"></param>
        /// <returns></returns>
        public static bool GetTemplateHtml(int categoryId)
        {
            Wis.Toolkit.DataProvider dataProvider = new Wis.Toolkit.DataProvider(Setting.ConnectionString);
            dataProvider.Open();
            string CommandText = string.Format("select * from Template where CategoryId ={0}", categoryId);
            try
            {
                System.Data.DataTable dt = dataProvider.ExecuteDataset(CommandText).Tables[0];
                dataProvider.Close();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    tempcontent = ReadHtml(dt.Rows[i]["TemplatePath"].ToString());
                    ReplacelistLabels();
                    WriteHtmls(tempcontent, System.Web.HttpContext.Current.Request.PhysicalApplicationPath + dt.Rows[i]["ReleasePath"].ToString());
                }
                return true;
            }
            catch
            {
                if (!dataProvider.IsClosed) dataProvider.Close();
                return false;

            }
        }