コード例 #1
0
    private void setting(int itype, DropDownList ddlname)
    {
        DataTable dt = DBqiye.getDataTable("SELECT  [ID],[Name]  FROM [dbo].[Setting] where SettingID=" + itype + " and state=1");

        ddlname.DataSource     = dt;
        ddlname.DataTextField  = "Name";
        ddlname.DataValueField = "ID";
        ddlname.DataBind();
        ddlname.Items.Insert(0, new ListItem("==全部==", "0"));
        ddlname.SelectedValue = "";
    }
コード例 #2
0
    public static string _getSettingName(string sid)
    {
        string    value = string.Empty;
        DataTable dt    = DBqiye.getDataTable("SELECT TOP 1 [Name]  FROM [dbo].[Setting] where id='" + sid + "'");

        if (dt.Rows.Count > 0)
        {
            value = dt.Rows[0][0].ToString();
        }
        return(value);
    }
コード例 #3
0
    public static string _getParaValue(string para)
    {
        string    value = string.Empty;
        DataTable dt    = DBqiye.getDataTable("select value from syspara where para='" + para + "'");

        if (dt.Rows.Count > 0)
        {
            value = dt.Rows[0][0].ToString();
        }
        return(value);
    }
コード例 #4
0
    private void Recommend()
    {
        DataTable dt = DBqiye.getDataTable("SELECT [ID] ,[Name] FROM [dbo].[Recommend]");

        tunjiang.DataSource     = dt;
        tunjiang.DataTextField  = "Name";
        tunjiang.DataValueField = "ID";
        tunjiang.DataBind();
        tunjiang.Items.Insert(0, new ListItem("==请选择==", ""));
        tunjiang.SelectedValue = "";
    }
コード例 #5
0
    private String settingname(string itype)
    {
        string    str = "";
        DataTable dt  = DBqiye.getDataTable("SELECT  [ID],[Name]  FROM [dbo].[Setting] where id=" + itype + "");

        if (dt.Rows.Count > 0)
        {
            str = dt.Rows[0]["Name"].ToString();
        }
        return(str);
    }
コード例 #6
0
    private void company(DropDownList ddlname)
    {
        int       classid = 18;
        DataTable dt      = DBqiye.getDataTable("SELECT ID,[Name]  FROM [dbo].[company] where charindex(',18,',  ','+typeid+',')>0  ");

        ddlname.DataSource     = dt;
        ddlname.DataTextField  = "Name";
        ddlname.DataValueField = "ID";
        ddlname.DataBind();
        ddlname.Items.Insert(0, new ListItem("==选择企业==", "0"));
        ddlname.SelectedValue = "";
    }
コード例 #7
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        DataTable dt;

        dt = DBqiye.getDataTable("select  top 1000 * from Results  where biaoqian is not null and biaoqianstate is null ");
        try
        {
            if (dt.Rows.Count > 0)
            {
                string ID       = "";
                string biaoqian = "";
                string sql      = "";
                //string biaoarray = "";
                //DataRow dr = dt.Rows[0];
                foreach (DataRow row in dt.Rows)
                {
                    ID       = row["ID"].ToString();
                    biaoqian = row["biaoqian"].ToString();
                    string[] biaoarray = biaoqian.Split(',');
                    for (int i = 0; i < biaoarray.Length; i++)
                    {
                        if (biaoarray[i].Length > 0)
                        {
                            sql  = " declare  @counts int ";
                            sql += "select @counts=count(*) from [Setting]  where name='" + biaoarray[i] + "' and [SettingID]=40 and state=1";
                            sql += " if (@counts=0) INSERT INTO [dbo].[Setting]([SettingID],[Name],[state])VALUES(40,'" + biaoarray[i] + "',1) ";
                            DBqiye.getDataTable(sql);
                        }
                    }
                    sql = "update results set biaoqianstate=1 where id=" + ID + "";
                    DBqiye.getDataTable(sql);
                    Label5.Text = biaoqian + "入库成功,id号:" + ID;
                    Label5.Text = "入库成功条数:" + dt.Rows.Count;
                }
                //DBqiye.getRowsCount("update ResultZheng set MinZFName='/min'+zhengshufile where CNO=" + sid);
            }
            if (dt.Rows.Count == 0)
            {
                Label5.Text = " 没有标签,需要入库";
            }
        }
        catch
        {
            Label5.Text = " 标签查询错误";
            //myGrid. = 0;
            //GridView1.DataSource = dt;
            //GridView1.DataBind();
        }
        finally
        {
        }
    }
コード例 #8
0
ファイル: jscg.aspx.cs プロジェクト: zhaochong820305/webzqhl
    private void BindGrid()
    {
        DataTable dt;
        string    sql = @"SELECT  p.*,c.Name as CName,(select top 1  s.Name from Setting s where s.id = p.TechLevel ) as TechLevelname,
                       (select top 1  s.Name from Setting s where s.id = p.HangYe ) as HangYeName,
                       (select top 1  s.Name from Setting s where s.id = p.ResultsType ) as ResultsTypeName
                       FROM  [dbo].[Technology] p left join Company c on c.ID=p.CompanyID where ( p.state=1   ) ";

        if (ddlCompany.SelectedValue != "0")
        {
            sql += " and    p.CompanyID=" + ddlCompany.SelectedValue;
        }

        //[Tech_LaiYuan]
        if (ddlLaiYuan.SelectedValue != "0")
        {
            sql += " and    p.ResultsType=" + ddlLaiYuan.SelectedValue;
        }
        if (ddlDiWei.SelectedValue != "0")
        {
            sql += " and    p.TechLevel=" + ddlDiWei.SelectedValue;
        }
        if (ddlhangye.SelectedValue != "0")
        {
            sql += " and    p.HangYe=" + ddlhangye.SelectedValue;
        }

        if (Session["title"].ToString() != "3")
        {
            sql += " and c.UserID='" + Session["userid"] + "' ";
        }
        sql += " order by p.id desc";
        dt   = DBqiye.getDataTable(sql);
        try
        {
            myGrid.DataSource = dt;
            myGrid.DataBind();
            PgCount = myGrid.PageCount;
            PgIndex = myGrid.PageIndex; RCount = dt.Rows.Count;
        }
        catch
        {
            //myGrid. = 0;
            myGrid.DataSource = dt;
            myGrid.DataBind();
        }
        finally
        {
        }
    }
コード例 #9
0
    protected void Button17_Click(object sender, EventArgs e)
    {
        if (biaoqianadd.Text.Length == 0)
        {
            Label1.Text = ("标签不允许为空!");
            biaoqianadd.Focus();
            return;
        }
        cid    = Request.QueryString["id"].ToString();
        typeid = 1;
        //string pingjiajielun1 = pingjiajielun.Text;
        //pingjiajielun1 = pingjiajielun.Text.Replace(Char.ConvertFromUtf32(32), "&nbsp;").Replace(Char.ConvertFromUtf32(13), "<br />"), "<br />");

        string sql   = "";
        string value = "";

        sql = "select count(*) from Setting where SettingID=40 and name= '" + biaoqianadd.Text.Trim() + "'";
        DataTable dt = DBqiye.getDataTable(sql);

        if (dt.Rows.Count > 0)
        {
            value = dt.Rows[0][0].ToString();
            if (value != "0")
            {
                Label14.Text = "标签名已经添加,请用新名添加";
                return;
            }
        }

        {
            sql = @"INSERT INTO [dbo].[Setting]
                           ([SettingID]           ,[Name]           ,[state])
                     VALUES           (40,'" + biaoqianadd.Text.Trim() + "',1)";
        }
        int count = DBqiye.getRowsCount(sql);

        sql = "";

        setting(40, ddlbiaoqian);  //成果标签
        biaoqian.Text += biaoqianadd.Text.Trim() + ",";
        if (count > 0)
        {
            Label14.Text = "标签保存成功" + sql;
        }
        else
        {
            Label14.Text = "保存失败" + sql;
        }
    }
コード例 #10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        msg.Text = "";
        if (user.Text.Length == 0)
        {
            msg.Text = "请输入用户名,谢谢";
            return;
        }
        //DataTable dt = DBC.getDataTable("select * from zqhl_users where  loginuser='******'");
        DataTable dt1 = DBqiye.getDataTable("select * from [dbo].[Company] where   [state]=1 and  MemberName='" + Common.strFilter(user.Text) + "'");

        if (dt1.Rows.Count == 0)
        {
            msg.Text = "用户名或密码错误";
            return;
        }
        //if(dt.Rows.Count>0)
        //{
        //    if (!dt.Rows[0]["pass"].ToString().Equals(MD5.CreateMD5Hash(pass.Text)))
        //    {
        //        msg.Text = "用户名或密码错误";
        //        return;
        //    }
        //    Session["adminloginuser"] = dt.Rows[0]["loginuser"].ToString();
        //}
        if (dt1.Rows.Count > 0)
        {
            if (!dt1.Rows[0]["Password"].ToString().Equals(MD5.CreateMD5Hash(pass.Text)))
            {
                msg.Text = "用户名或密码错误";
                return;
            }
            Session["MemberName"] = dt1.Rows[0]["MemberName"].ToString();
            Session["sid"]        = dt1.Rows[0]["id"].ToString();
            Session["usertypes"]  = dt1.Rows[0]["usertypes"].ToString(); //usertypes.SelectedValue;
                                                                         //Session["title"] = dt1.Rows[0]["title"].ToString();
            if (Session["usertypes"].ToString() == "211")
            {
                Response.Redirect("comperson.aspx");
            }
            else
            {
                Response.Redirect("comindex.aspx");
            }
        }

        // Response.Redirect("main.aspx");
    }
コード例 #11
0
    private void company()
    {
        string sql = "SELECT  [ID] ,[Name] FROM  [dbo].[Company] where 1=1   and name<>''  and state=1  order by name ";
        //if (Session["title"].ToString() != "3")
        //{
        //    sql += " and UserID='" + Session["userid"] + "' ";
        //}
        DataTable dt = DBqiye.getDataTable(sql);

        ddlCompany.DataSource     = dt;
        ddlCompany.DataTextField  = "Name";
        ddlCompany.DataValueField = "ID";
        ddlCompany.DataBind();
        ddlCompany.Items.Insert(0, new ListItem("==全部==", "0"));
        ddlCompany.SelectedValue = "";
    }
コード例 #12
0
    protected void Button61_Click(object sender, EventArgs e)
    {
        DataTable dt;

        dt = DBqiye.getDataTable("SELECT *  FROM [dbo].[ResultPic] where  state=1 ");
        try
        {
            if (dt.Rows.Count > 0)
            {
                string zhengshufile = "";
                string minfile      = "";
                string yuanfile     = "";
                //DataRow dr = dt.Rows[0];
                foreach (DataRow row in dt.Rows)
                {
                    zhengshufile = row["FileName"].ToString();
                    minfile      = Server.MapPath("../") + "/min" + zhengshufile;
                    yuanfile     = Server.MapPath("../") + "/yuan" + zhengshufile;
                    zhengshufile = Server.MapPath("../" + zhengshufile);

                    try
                    {
                        imgtext.BuildWatermark(yuanfile, Server.MapPath("/") + "/images/shuiyinshen.png", "www.kjcgjy.com", zhengshufile);
                    }
                    catch { Label5.Text += zhengshufile + ";错"; }
                    //imgtext.AddWaterText(yuanfile, "www.kjcgjy.com", zhengshufile, 255, 50);
                    // MakeThumbnail(zhengshufile, minfile, 225, 300, "HW");
                    Label5.Text = "上传缩微图证书成功+水印";
                }
                //DBqiye.getRowsCount("update ResultZheng set MinZFName='/min'+zhengshufile where CNO=" + sid);
            }
            if (dt.Rows.Count == 0)
            {
                Label5.Text = " 没有查询到证书信息";
            }
        }
        catch
        {
            Label5.Text = " 证书信息查询错误";
            //myGrid. = 0;
            //GridView1.DataSource = dt;
            //GridView1.DataBind();
        }
        finally
        {
        }
    }
コード例 #13
0
    private String settingnamearray(string stra)
    {
        string[]  strarray = stra.Split(',');
        string    str      = "";
        DataTable dt;

        for (int i = 0; i < strarray.Length; i++)
        {
            dt = DBqiye.getDataTable("SELECT  [ID],[Name]  FROM [dbo].[Setting] where id=" + strarray[i] + "");
            if (dt.Rows.Count > 0)
            {
                str += dt.Rows[0]["Name"].ToString() + ",";
            }
        }

        return(str);
    }
コード例 #14
0
    private void yewubd()
    {
        string sql = "SELECT [UserID],[RealName]        FROM[dbo].[User] where Enabled=1 ";

        if (Session["userid"].ToString() != "3" && Session["userid"].ToString() != "4" && Session["userid"].ToString() != "13" && Session["title"].ToString() != "4")
        {
            sql += "  and  UserID='" + Session["userid"] + "' ";
        }
        DataTable dt = DBqiye.getDataTable(sql);

        yewu.DataSource     = dt;
        yewu.DataTextField  = "RealName";
        yewu.DataValueField = "UserID";
        yewu.DataBind();
        yewu.Items.Insert(0, new ListItem("==请选择==", ""));
        yewu.SelectedValue = "";
    }
コード例 #15
0
    private void BindZhengpicshuiyin(string sid)
    {
        DataTable dt;
        string    sql = @"SELECT *,(select[name] FROM Setting where id = r.zhengshutype) typename FROM[dbo].[ResultZheng]
                     r where CNO = " + sid + " and state = 1 ";

        dt = DBqiye.getDataTable(sql);
        try
        {
            if (dt.Rows.Count > 0)
            {
                string zhengshufile = "";
                string minfile      = "";
                string yuanfile     = "";
                //DataRow dr = dt.Rows[0];
                foreach (DataRow row in dt.Rows)
                {
                    zhengshufile = row["zhengshufile"].ToString();
                    minfile      = Server.MapPath("../") + "/min" + zhengshufile;
                    yuanfile     = Server.MapPath("../") + "/yuan" + zhengshufile;
                    zhengshufile = Server.MapPath("../" + zhengshufile);

                    imgtext.BuildWatermark(yuanfile, Server.MapPath("/") + "/images/shunyin.png", "www.kjcgjy.com", zhengshufile);
                    MakeThumbnail(zhengshufile, minfile, 225, 300, "HW");
                    Label3.Text = "上传缩微图证书成功+水印";
                }
                DBqiye.getRowsCount("update ResultZheng set MinZFName='/min'+zhengshufile where CNO=" + sid);
            }
            if (dt.Rows.Count == 0)
            {
                Label3.Text = " 没有查询到证书信息" + sql;
            }
        }
        catch
        {
            Label3.Text = " 证书信息查询错误" + sql;
            //myGrid. = 0;
            //GridView1.DataSource = dt;
            //GridView1.DataBind();
        }
        finally
        {
        }
    }
コード例 #16
0
    private void BindGrid()
    {
        DataTable dt;
        string    sql = @"SELECT *  FROM  [mingpian] where (state=1 )  ";


        if (Session["userid"].ToString() != "3" && Session["userid"].ToString() != "4" && Session["userid"].ToString() != "13" && Session["title"].ToString() != "4")
        {
            sql += " and UserID='" + Session["userid"] + "' ";
        }
        if (yewu.SelectedValue.ToString() != "")
        {
            sql += " and UserID='" + yewu.SelectedValue + "' ";
        }
        if (name.Text.ToString() != "")
        {
            sql += " and name like '%" + name.Text + "%' ";
        }
        if (company.Text.ToString() != "")
        {
            sql += " and company like '%" + company.Text + "%' ";
        }
        //Response.Write(sql);
        sql += " order by name";
        dt   = DBqiye.getDataTable(sql);
        try
        {
            myGrid.DataSource = dt;
            myGrid.DataBind();
            PgCount = myGrid.PageCount;
            PgIndex = myGrid.PageIndex; RCount = dt.Rows.Count;
        }
        catch
        {
            //myGrid. = 0;
            myGrid.DataSource = dt;
            myGrid.DataBind();
        }
        finally
        {
        }
    }
コード例 #17
0
    //private void yewubd()
    //{
    //    string sql = "SELECT [UserID],[RealName]        FROM[dbo].[User]  where Enabled=1  ";
    //    if (Session["title"].ToString() != "3")
    //    {
    //        sql += "  and  UserID='" + Session["userid"] + "' ";
    //    }
    //    DataTable dt = DBqiye.getDataTable(sql);
    //    yewu.DataSource = dt;
    //    yewu.DataTextField = "RealName";
    //    yewu.DataValueField = "UserID";
    //    yewu.DataBind();
    //    if (Session["title"].ToString() == "3")
    //    {
    //        yewu.Items.Insert(0, new ListItem("==请选择==", ""));
    //        yewu.SelectedValue = "";
    //    }

    //}

    private void setting(int itype, DropDownList ddlname)
    {
        string sql = "SELECT  [ID],[Name]  FROM [dbo].[Setting] where SettingID=" + itype + " and state=1 ";

        {
            sql += " order by id desc";
        }

        DataTable dt = DBqiye.getDataTable(sql);

        //DataTable dt = DBqiye.getDataTable("SELECT  [ID],[Name]  FROM [dbo].[Setting] where SettingID=" + itype + " and state=1 order by [id] ");
        ddlname.DataSource     = dt;
        ddlname.DataTextField  = "Name";
        ddlname.DataValueField = "ID";
        ddlname.DataBind();
        if (itype != 40)
        {
            ddlname.Items.Insert(0, new ListItem("==请选择==", "0"));
            ddlname.SelectedValue = "0";
        }
    }
コード例 #18
0
    //private void yewubd()
    //{
    //    string sql = "SELECT [UserID],[RealName]        FROM[dbo].[User]  where Enabled=1  ";
    //    if (Session["title"].ToString() != "3")
    //    {
    //        sql += "  and  UserID='" + Session["userid"] + "' ";
    //    }
    //    DataTable dt = DBqiye.getDataTable(sql);
    //    yewu.DataSource = dt;
    //    yewu.DataTextField = "RealName";
    //    yewu.DataValueField = "UserID";
    //    yewu.DataBind();
    //    if (Session["title"].ToString() == "3")
    //    {
    //        yewu.Items.Insert(0, new ListItem("==请选择==", ""));
    //        yewu.SelectedValue = "";
    //    }

    //}

    private void setting(int itype, DropDownList ddlname)
    {
        DataTable dt = DBqiye.getDataTable("SELECT  [ID],[Name]  FROM [dbo].[Setting] where SettingID=" + itype + " and state=1 order by [Name] ");

        ddlname.DataSource     = dt;
        ddlname.DataTextField  = "Name";
        ddlname.DataValueField = "ID";
        ddlname.DataBind();
        ddlname.Items.Insert(0, new ListItem("==请选择==", "0"));
        ddlname.SelectedValue = "0";
        if (itype == 40)
        {
            int    i   = 1;
            string str = "";
            foreach (DataRow dr in dt.Rows)
            {
                str += "{ k: " + i.ToString() + ",v: '" + dr["Name"].ToString() + "'}|";
            }
            hfddlList.Value = str.Substring(0, str.Length - 1);
        }
    }
コード例 #19
0
    private void BindGrid()
    {
        DataTable dt;

        dt = DBqiye.getDataTable("SELECT *  FROM[dbo].[CompanyInfo] order by id desc");
        try
        {
            myGrid.DataSource = dt;
            myGrid.DataBind();
            PgCount = myGrid.PageCount;
            PgIndex = myGrid.PageIndex; RCount = dt.Rows.Count;
        }
        catch
        {
            //myGrid. = 0;
            myGrid.DataSource = dt;
            myGrid.DataBind();
        }
        finally
        {
        }
    }
コード例 #20
0
ファイル: Login.aspx.cs プロジェクト: zhaochong820305/webzqhl
    protected void Button1_Click(object sender, EventArgs e)
    {
        msg.Text = "";
        if (user.Text.Length == 0)
        {
            msg.Text = "请输入用户名,谢谢";
            return;
        }
        //DataTable dt = DBC.getDataTable("select * from zqhl_users where  loginuser='******'");
        DataTable dt1 = DBqiye.getDataTable("select * from [dbo].[User] where   [Enabled]=1 and  LoginName='" + Common.strFilter(user.Text) + "'");

        if (dt1.Rows.Count == 0)
        {
            msg.Text = "用户名或密码错误";
            return;
        }
        //if(dt.Rows.Count>0)
        //{
        //    if (!dt.Rows[0]["pass"].ToString().Equals(MD5.CreateMD5Hash(pass.Text)))
        //    {
        //        msg.Text = "用户名或密码错误";
        //        return;
        //    }
        //    Session["adminloginuser"] = dt.Rows[0]["loginuser"].ToString();
        //}
        if (dt1.Rows.Count > 0)
        {
            if (!dt1.Rows[0]["Password"].ToString().Equals(MD5.CreateMD5Hash(pass.Text)))
            {
                msg.Text = "用户名或密码错误";
                return;
            }
            Session["adminloginuser"] = dt1.Rows[0]["LoginName"].ToString();
            Session["userid"]         = dt1.Rows[0]["UserID"].ToString();
            Session["title"]          = dt1.Rows[0]["title"].ToString();
        }

        Response.Redirect("main.aspx");
    }
コード例 #21
0
    private void hangye2fl(string sid, int itype)
    {
        string sql = string.Empty;

        sql = "SELECT [ID] ,[Name]  FROM [dbo].[HangYe2] where HangYeID=" + sid + "";

        DataTable dt = DBqiye.getDataTable(sql);

        hangye2.DataSource     = dt;
        hangye2.DataTextField  = "Name";
        hangye2.DataValueField = "ID";
        hangye2.DataBind();
        hangye2.Items.Insert(0, new ListItem("==请选择==", ""));
        if (itype == 0)
        {
            hangye2.SelectedValue = "";
        }
        else
        {
            hangye2.SelectedValue = itype.ToString();
        }
    }
コード例 #22
0
    private void BindGrid()
    {
        string    sid = scompanyid;
        DataTable dt;

        dt = DBqiye.getDataTable(@"select *,(select Name from  [dbo].[Setting] where [ID]=b.Region) as City
                                    ,(select Name from  [dbo].[Setting] where [ID]=b.EnterpriseType) as EnterType
                                     ,(select Name from  [dbo].[Setting] where [ID]=b.KeyAreas) as KeyArea
                                    from [Company] b where b.id=" + sid + " order by b.id desc   ");

        try
        {
            if (dt.Rows.Count > 0)
            {
                string  sShangShi = "否";
                DataRow dr        = dt.Rows[0];
                //scompanyid = dr["id"].ToString();

                //
                if (dr["Incentive_HasStock"].ToString() == "True")
                {
                    cbguquan.Checked = true;
                }
                else
                {
                    cbguquan.Checked = false;
                }
                tbjili.Text = dr["Incentive_StockInfo"].ToString();
            }
        }
        catch
        {
            //myGrid. = 0;
        }
        finally
        {
        }
    }
コード例 #23
0
ファイル: bumen.aspx.cs プロジェクト: zhaochong820305/webzqhl
    private void BindGrid()
    {
        DataTable dt;
        string    sql = @"SELECT   *  FROM  [dbo].[Department]";

        dt = DBqiye.getDataTable(sql);
        try
        {
            myGrid.DataSource = dt;
            myGrid.DataBind();
            PgCount = myGrid.PageCount;
            PgIndex = myGrid.PageIndex; RCount = dt.Rows.Count;
        }
        catch
        {
            //myGrid. = 0;
            myGrid.DataSource = dt;
            myGrid.DataBind();
        }
        finally
        {
        }
    }
コード例 #24
0
    private void BindGrid()
    {
        DataTable dt;
        string    sql = @"SELECT   [ID]      ,[HangYeID]      ,[Name]      ,[Description]  FROM [dbo].[HangYe2] where (state=1 or state is null) and  [HangYeID]=" + stype;

        dt = DBqiye.getDataTable(sql);
        try
        {
            myGrid.DataSource = dt;
            myGrid.DataBind();
            PgCount = myGrid.PageCount;
            PgIndex = myGrid.PageIndex; RCount = dt.Rows.Count;
        }
        catch
        {
            //myGrid. = 0;
            myGrid.DataSource = dt;
            myGrid.DataBind();
        }
        finally
        {
        }
    }
コード例 #25
0
    private void company(string sname)
    {
        string sql = "SELECT  [ID] ,[Name] FROM  [dbo].[Company] where state=1 ";

        if (Session["title"].ToString() != "3" && Session["title"].ToString() != "5")
        {
            sql += " and UserID='" + Session["userid"] + "' ";
        }
        if (sname.Length > 0)
        {
            sql += " and [Name] like '%" + sname + "%' ";
        }

        DataTable dt = DBqiye.getDataTable(sql);

        ChiYouRenID.Items.Clear();
        ChiYouRenID.DataSource     = dt;
        ChiYouRenID.DataTextField  = "Name";
        ChiYouRenID.DataValueField = "ID";
        ChiYouRenID.DataBind();
        ChiYouRenID.Items.Insert(0, new ListItem("==请选择==", ""));
        ChiYouRenID.SelectedValue = "";
    }
コード例 #26
0
    private void BindGrid()
    {
        DataTable dt;
        string    sql = @"SELECT   [ID]      ,[Name]      ,[Mobile]      ,[CreateDate]  FROM  [dbo].[Recommend] where state=1 or state is null ";

        dt = DBqiye.getDataTable(sql);
        try
        {
            myGrid.DataSource = dt;
            myGrid.DataBind();
            PgCount = myGrid.PageCount;
            PgIndex = myGrid.PageIndex; RCount = dt.Rows.Count;
        }
        catch
        {
            //myGrid. = 0;
            myGrid.DataSource = dt;
            myGrid.DataBind();
        }
        finally
        {
        }
    }
コード例 #27
0
    private void BindZheng(string sid)
    {
        DataTable dt;
        string    sql = @"SELECT *,(select[name] FROM Setting where id = r.zhengshutype) typename FROM[dbo].[ResultZheng]
                     r where CNO = " + sid + " and state = 1 ";

        if (title.Text.Length > 0)
        {
            sql += " zhengshuname like '%" + title.Text + "%' ";
        }
        sql += " ORDER BY ID DESC";
        dt   = DBqiye.getDataTable(sql);
        try
        {
            myGrid.DataSource = dt;
            myGrid.DataBind();
            PgCount = myGrid.PageCount;
            PgIndex = myGrid.PageIndex; RCount = dt.Rows.Count;
            ///PgCount = GridView1.PageCount;
            //PgIndex = GridView1.PageIndex; GridView1 = dt.Rows.Count;
            if (dt.Rows.Count == 0)
            {
                Label3.Text = " 没有查询到证书信息";
            }
        }
        catch
        {
            Label3.Text = " 证书信息查询错误";
            //myGrid. = 0;
            //GridView1.DataSource = dt;
            //GridView1.DataBind();
        }
        finally
        {
        }
    }
コード例 #28
0
    protected void hangye2_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataTable dt;

        dt = DBqiye.getDataTable(@"SELECT TOP 1 *  FROM [dbo].HangYe2 where id =" + hangye2.SelectedValue + "   ");

        try
        {
            if (dt.Rows.Count > 0)
            {
                string  sShangShi = "否";
                DataRow dr        = dt.Rows[0];
                Label7.Text = dr["Description"].ToString();;
            }
        }
        catch
        {
            //myGrid. = 0;
            Label7.Text = "";
        }
        finally
        {
        }
    }
コード例 #29
0
    private void BindGrid()
    {
        DataTable dt;
        string    sql = @" SELECT   r.*,c.ContactTel cname,re.RName  FROM [dbo].[ResultsLiuYan] r  left join company c on r.CompanyID=c.ID left join Results re on re.id=r.cid  ";


        dt = DBqiye.getDataTable(sql);
        try
        {
            myGrid.DataSource = dt;
            myGrid.DataBind();
            PgCount = myGrid.PageCount;
            PgIndex = myGrid.PageIndex; RCount = dt.Rows.Count;
        }
        catch
        {
            //myGrid. = 0;
            myGrid.DataSource = dt;
            myGrid.DataBind();
        }
        finally
        {
        }
    }
コード例 #30
0
ファイル: HeZuo.aspx.cs プロジェクト: zhaochong820305/webzqhl
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Common.isAdminLogin())
        {
            Response.Redirect("login.aspx");
            Response.End();
        }
        if (Request.QueryString["pid"] != null && (!string.IsNullOrEmpty(Request.QueryString["pid"])) && Request.QueryString["pid"].Length > 0)
        {
            pid = Request.QueryString["pid"].ToString();
        }
        else
        {
            Label1.Text = "请选择项目,否则无法显示";
            return;
        }

        if (!Page.IsPostBack)
        {
            string op = Request.QueryString["op"].ToString();
            if (op == "edit" || op == "kan")
            {
                if (op == "edit")
                {
                    Button4.Visible = false;
                    Button5.Visible = true;
                }
                else
                {
                    Button4.Visible = false;
                    Button5.Visible = false;
                }

                try
                {
                    int       id = Convert.ToInt32(Request.QueryString["id"]);
                    DataTable dt;
                    dt = DBqiye.getDataTable(@"SELECT * ,(select Name from Setting where id =c.Type) as TName 
                                   ,(select Name from Setting where id = c.MainDirection) as MName
                                   ,(select Name from Setting where id = c.EnterpriseType) as EName  FROM  [dbo].[Cooperation] c where ProjectID = " + pid);


                    if (dt.Rows.Count > 0)
                    {
                        DataRow dr = dt.Rows[0];

                        ddlLeiBie.SelectedValue  = dr["Type"].ToString();
                        ddlXingZhi.SelectedValue = dr["EnterpriseType"].ToString();
                        ddlHangYe.SelectedValue  = dr["MainDirection"].ToString();
                        tbGuiMe.Text             = dr["Scale"].ToString();
                        tbMiaoShu.Text           = dr["Description"].ToString();
                        //icompanyid = Convert.ToInt32(dr["CompanyID"].ToString());
                    }
                }
                catch
                {
                    //myGrid. = 0;
                }
                finally
                {
                }
            }
            else
            {
                //icompanyid = Convert.ToInt32(Request.QueryString["cid"]);
                Button4.Visible = true;
                Button5.Visible = false;
            }
            //company(); //绑定公司名称
            setting(4, ddlXingZhi); // 性质
            setting(3, ddlHangYe);  // 行业
            setting(17, ddlLeiBie); //类别
        }
    }