zoukankan      html  css  js  c++  java
  • tabelrowcell__temp

    using System;
    using System.Runtime.InteropServices;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Serialization;

    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.WebPartPages;

    namespace WebPart
    {
        [Guid("5d617724-06ed-43c9-9ad0-0d0976d82e7c")]
        public class ListAdd : System.Web.UI.WebControls.WebParts.WebPart
        {
            public ListAdd()
            {
            }
            TextBox txtBH = new TextBox();
            TextBox txtYY = new TextBox();

            protected override void CreateChildControls()
            {
                base.CreateChildControls();

                System.Web.UI.HtmlControls.HtmlTable table = new System.Web.UI.HtmlControls.HtmlTable();

                System.Web.UI.HtmlControls.HtmlTableRow tablerow1 = new System.Web.UI.HtmlControls.HtmlTableRow();
                System.Web.UI.HtmlControls.HtmlTableCell tablecell = new System.Web.UI.HtmlControls.HtmlTableCell();
                Label lable1 = new Label();
                lable1.Text = "输入请假编号:";
                tablecell.Controls.Add(lable1);

                System.Web.UI.HtmlControls.HtmlTableCell tablecell2 = new System.Web.UI.HtmlControls.HtmlTableCell();

                tablecell2.Controls.Add(txtBH);


                tablerow1.Controls.Add(tablecell);
                tablerow1.Controls.Add(tablecell2);
                table.Controls.Add(tablerow1);


                tablerow1 = new System.Web.UI.HtmlControls.HtmlTableRow();
                tablecell = new System.Web.UI.HtmlControls.HtmlTableCell();
                lable1 = new Label();
                lable1.Text = "请假原因:";
                tablecell.Controls.Add(lable1);

                tablecell2 = new System.Web.UI.HtmlControls.HtmlTableCell();

                tablecell2.Controls.Add(txtYY);


                tablerow1.Controls.Add(tablecell);
                tablerow1.Controls.Add(tablecell2);
                table.Controls.Add(tablerow1);


                this.Controls.Add(table);


                Button btnadd = new Button();           
                btnadd.Text = "新增列表项";


               

                btnadd.Attributes.Add("onclick", "return   confirm('确定提交吗?');");

                this.Load += new EventHandler(btnadd_onclick);
                this.Controls.Add(btnadd);


            }
             private void btnadd_onclick(object sender, EventArgs e)
            {

                string qjts = this.txtBH.Text.Trim().ToString();
                string qjyy = this.txtYY.Text.Trim().ToString();

                if (qjts.Length > 0 && qjyy.Length>0)
                {
                   
               

                  // Guid listID=(System.Guid)("05e0675b-3125-44fd-bd83-6a434250b1ae");
                    SPWeb web = SPControl.GetContextWeb(Context);
                    SPList list = web.Lists["测试列表"];
                               
                   
                    SPListItemCollection lists = list.Items;
                    SPListItem listitem = list.Items.Add();

                    listitem["请假天数"] = qjts;// txtBH.Text;

                    listitem["请假原因"] = qjyy;// txtYY.Text;

                    listitem.Update();

                    this.txtYY.Text = "";
                    this.txtBH.Text = "";

                }
     

            }
        }


        }

    /Files/IsNull/WebPart.rar
  • 相关阅读:
    GDI+ 实现透明水印和文字
    delphi 7.0 DateTimePicker控件相同日期比较的问题
    LISTVIEW显示JPEG缩略图
    Delphi在Listview中加入Eeit控件
    LISTVIEW导出到EXCEL的通用函数
    在DateTimePicker上显示星期几
    用hook实现dll注入详解
    Delphi 动态选择控件的输入法
    Delphi FastReport动态加载图片
    项目中必须知道有关css和html的常识
  • 原文地址:https://www.cnblogs.com/IsNull/p/1792502.html
Copyright © 2011-2022 走看看