private void BindData()
 {
     ow_teamControl ow_teamControl = new ow_teamControl();
     DataTable table = null;
     table = ow_teamControl.GetTable(1, "ID");
     if (table!=null&&table.Rows.Count>0)
     {
         this.repdata.DataSource = table.DefaultView;
         this.repdata.DataBind();
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            ow_teamControl ow_teamControl  = new DataBaseControl.ow_teamControl();
            DataTable      table           = null;
            DataRow        dr              = null;
            string         Result          = "yes";
            string         txtLeadername   = context.Request["txtLeadername"];   //名字
            string         txtIntroduction = context.Request["txtIntroduction"]; //介绍
            string         imgHeadPortrait = context.Request["imgHeadPortrait"]; //图片
            string         id              = context.Request["teamid"];

            if (string.IsNullOrEmpty(id))
            {
                //新增
                table = ow_teamControl.GetTable(0, "");
                if (table != null)
                {
                    dr                   = table.NewRow();
                    dr["Title"]          = txtLeadername;
                    dr["Introduction"]   = txtIntroduction;
                    dr["Img"]            = imgHeadPortrait;
                    dr["createdatetime"] = DateTime.Now.ToString("f");
                    dr["updatetime"]     = DateTime.Now.ToString("f");
                    table.Rows.Add(dr);
                    ow_teamControl.Update("ID", table, 0);
                }
            }
            else
            {
                //修改
                table = ow_teamControl.GetTable(1, id);
                if (table != null && table.Rows.Count > 0)
                {
                    dr                 = table.Rows[0];
                    dr["Title"]        = txtLeadername;
                    dr["Introduction"] = txtIntroduction;
                    dr["Img"]          = imgHeadPortrait;
                    //dr["createdatetime"] = txtLeadername;
                    dr["updatetime"] = DateTime.Now.ToString("f");
                    //table.Rows.Add(dr);
                    table.Columns["ID"].Prefix = "where";
                    ow_teamControl.Update("ID", table, 1);
                }
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write("{\"Result\":\"" + Result + "\",\"imgHeadPortrait\":\"" + imgHeadPortrait + "\"}");
        }
        public void ProcessRequest(HttpContext context)
        {
            ow_teamControl ow_teamControl = new DataBaseControl.ow_teamControl();
            DataTable table = null;
            DataRow dr = null ;
            string Result = "yes";
            string txtLeadername = context.Request["txtLeadername"];//名字
            string txtIntroduction = context.Request["txtIntroduction"];//介绍
            string imgHeadPortrait = context.Request["imgHeadPortrait"];//图片
            string id = context.Request["teamid"];

            if (string.IsNullOrEmpty(id))
            {
                //新增
                table = ow_teamControl.GetTable(0, "");
                if (table != null)
                {
                    dr = table.NewRow();
                    dr["Title"] = txtLeadername;
                    dr["Introduction"] = txtIntroduction;
                    dr["Img"] = imgHeadPortrait;
                    dr["createdatetime"] = DateTime.Now.ToString("f") ;
                    dr["updatetime"] = DateTime.Now.ToString("f");
                    table.Rows.Add(dr);
                    ow_teamControl.Update("ID", table, 0);
                }
            }
            else
            {
                //修改
                table = ow_teamControl.GetTable(1, id);
                if (table != null&&table.Rows.Count>0)
                {
                    dr = table.Rows[0];
                    dr["Title"] = txtLeadername;
                    dr["Introduction"] = txtIntroduction;
                    dr["Img"] = imgHeadPortrait;
                    //dr["createdatetime"] = txtLeadername;
                    dr["updatetime"] = DateTime.Now.ToString("f");
                    //table.Rows.Add(dr);
                    table.Columns["ID"].Prefix = "where";
                    ow_teamControl.Update("ID", table,1);
                }
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write("{\"Result\":\"" + Result + "\",\"imgHeadPortrait\":\"" + imgHeadPortrait + "\"}");
        }
        public void ProcessRequest(HttpContext context)
        {
            ow_teamControl ow_teamControl = new DataBaseControl.ow_teamControl();
            DataTable table = null;
            string id = context.Request["teamid"];
            table = ow_teamControl.GetTable(1, id);
            string json = "";
            if (table != null && table.Rows.Count > 0)
            {
                table.Columns["ID"].Prefix = "where";
                ow_teamControl.Update("ID", table, 2);
                json = "yes";
            }
            else
            {
                json = "no";
            }

            context.Response.ContentType = "text/plain";
            context.Response.Write("{\"Result\":\"" + json + "\"}");
        }
 public void ProcessRequest(HttpContext context)
 {
     ow_teamControl ow_teamControl = new DataBaseControl.ow_teamControl();
     DataTable table = null;
     string id = context.Request["Tag"];
     string txtLeadername = "";
     string txtIntroduction = "";
     string imgHeadPortrait = "";
     if (!string.IsNullOrEmpty(id))
     {
         table = ow_teamControl.GetTable(1, id);
         if (table!=null&&table.Rows.Count>0)
         {
             txtLeadername = table.Rows[0]["Title"].ToString();
             txtIntroduction = table.Rows[0]["Introduction"].ToString();
             imgHeadPortrait = table.Rows[0]["Img"].ToString();
         }
     }
     string json = "{\"txtLeadername\":\"" + txtLeadername + "\",\"txtIntroduction\":\"" + txtIntroduction + "\",\"imgHeadPortrait\":\"" + imgHeadPortrait + "\"}";
     context.Response.ContentType = "text/plain";
     context.Response.Write(json);
 }
        public void ProcessRequest(HttpContext context)
        {
            ow_teamControl ow_teamControl = new DataBaseControl.ow_teamControl();
            DataTable      table          = null;
            string         id             = context.Request["teamid"];

            table = ow_teamControl.GetTable(1, id);
            string json = "";

            if (table != null && table.Rows.Count > 0)
            {
                table.Columns["ID"].Prefix = "where";
                ow_teamControl.Update("ID", table, 2);
                json = "yes";
            }
            else
            {
                json = "no";
            }

            context.Response.ContentType = "text/plain";
            context.Response.Write("{\"Result\":\"" + json + "\"}");
        }
Example #7
0
        public void ProcessRequest(HttpContext context)
        {
            ow_teamControl ow_teamControl  = new DataBaseControl.ow_teamControl();
            DataTable      table           = null;
            string         id              = context.Request["Tag"];
            string         txtLeadername   = "";
            string         txtIntroduction = "";
            string         imgHeadPortrait = "";

            if (!string.IsNullOrEmpty(id))
            {
                table = ow_teamControl.GetTable(1, id);
                if (table != null && table.Rows.Count > 0)
                {
                    txtLeadername   = table.Rows[0]["Title"].ToString();
                    txtIntroduction = table.Rows[0]["Introduction"].ToString();
                    imgHeadPortrait = table.Rows[0]["Img"].ToString();
                }
            }
            string json = "{\"txtLeadername\":\"" + txtLeadername + "\",\"txtIntroduction\":\"" + txtIntroduction + "\",\"imgHeadPortrait\":\"" + imgHeadPortrait + "\"}";

            context.Response.ContentType = "text/plain";
            context.Response.Write(json);
        }