Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Chkadmin.checkadmin("login.aspx");
            string id = Request.QueryString["i"];

            ViewState["id"] = id;
            if (!Page.IsPostBack)
            {
                string   sql  = "select * from paperinfo where id=" + id;
                DataBase data = new DataBase();
                using (SqlDataReader dr = data.ExeSqlFillDr(sql))
                {
                    if (dr.Read())
                    {
                        TextPaper_Number.Text           = dr["paper_number"].ToString();
                        DdlTeacher_Number.SelectedIndex = DdlTeacher_Number.Items.IndexOf(DdlTeacher_Number.Items.FindByValue(dr["teacher_number"].ToString()));
                        TextTitle.Text            = dr["title"].ToString();
                        TextPublication_Name.Text = dr["publication_name"].ToString();
                        TextForm.Text             = dr["form"].ToString();
                        TextLevel.Text            = dr["paper_level"].ToString();
                        TextTime.Text             = dr["publish_time"].ToString();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Chkadmin.checkadmin("login.aspx");
            string id = Request.QueryString["i"];

            ViewState["id"] = id;
            if (!Page.IsPostBack)
            {
                string   sql  = "select * from awardinfo where id=" + id;
                DataBase data = new DataBase();
                using (SqlDataReader dr = data.ExeSqlFillDr(sql))
                {
                    if (dr.Read())
                    {
                        TextAward_number.Text           = dr["award_number"].ToString();
                        TextOrganization.Text           = dr["organization"].ToString();
                        DdlTeacher_Number.SelectedIndex = DdlTeacher_Number.Items.IndexOf(DdlTeacher_Number.Items.FindByValue(dr["teacher_number"].ToString()));
                        TextTime.Text        = dr["time"].ToString();
                        TextPresenter.Text   = dr["presenter"].ToString();
                        TextPrizewinner.Text = dr["prizewinner"].ToString();
                        TextType.Text        = dr["type"].ToString();
                        TextLevel.Text       = dr["award_level"].ToString();
                        TextForm.Text        = dr["form"].ToString();
                    }
                }
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Chkadmin.checkadmin("login.aspx");
            string id = Request.QueryString["i"];

            ViewState["id"] = id;
            if (!Page.IsPostBack)
            {
                string   sql  = "select * from projectinfo where prjid=" + id;
                DataBase data = new DataBase();
                using (SqlDataReader dr = data.ExeSqlFillDr(sql))
                {
                    if (dr.Read())
                    {
                        TextProject_Number.Text         = dr["project_number"].ToString();
                        TextProject_Name.Text           = dr["project_name"].ToString();
                        DdlTeacher_Number.SelectedIndex = DdlTeacher_Number.Items.IndexOf(DdlTeacher_Number.Items.FindByValue(dr["teacher_number"].ToString()));
                        TextTime.Text         = dr["time"].ToString();
                        TextOrganization.Text = dr["organization"].ToString();
                        TextId.Text           = dr["id"].ToString();
                        TextDirector.Text     = dr["director"].ToString();
                        TextFunds.Text        = dr["funds"].ToString();
                    }
                }
            }
        }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Chkadmin.checkadmin("login.aspx");
     if (!Page.IsPostBack)
     {
         dataBind();
     }
 }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Chkadmin.checkadmin("login.aspx");
     //if (!Page.IsPostBack)
     //{
     //    BindTree();
     //    ddltype.Attributes.Add("onchange", "selectChange(this,'" + this.ddltype.ClientID + "')");
     //}
 }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Chkadmin.checkadmin("login.aspx");
     action          = Request.QueryString["action"].ToString();
     id              = Request.QueryString["id"].ToString();
     ViewState["id"] = id;
     if (!IsPostBack)
     {
         //ddltype.Attributes.Add("onchange", "selectChange(this,'" + this.ddltype.ClientID + "')");
         Class         cls  = new Class();
         DataBase      data = new DataBase();
         SqlDataReader dr   = null;
         dr = data.ExeSqlFillDr("select * from userinfo where user_id=" + id);
         if (dr.Read())
         {
             username.Text = dr["Username"].ToString();
             //realName.Text = dr["realName"].ToString();
             //ddltype.SelectedIndex = ddltype.Items.IndexOf(ddltype.Items.FindByValue(dr["RightGroup"].ToString()));
             //string[] urights = dr["PermissionValue"].ToString().Split('|');
             //if (dr["RightGroup"].ToString() == "2")
             //{
             //    trguanli.Visible = true;
             //    foreach (ListItem item in userRight.Items)
             //    {
             //        //if (dr["userRight"].ToString().Contains(item.Value))
             //        foreach (string srig in urights)
             //        {
             //            if (srig.Trim() == item.Value)
             //                item.Selected = true;
             //        }
             //    }
             //}
             //ViewState["pvalue"] = dr["PermissionValue"].ToString();
         }
         dr.Close();
         dr.Dispose();
         //BindTree();
         switch (action)
         {
         case "dele":
             Class.DelInfo("delete from userinfo where user_id=" + id);
             WebJS.AlertAndRedirect("删除完成", "admin.aspx");
             break;
         }
     }
 }
Ejemplo n.º 7
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            string   sql1 = "select * from web_admin where username='******' and UserPassword='******'";
            DataBase data = new DataBase();

            using (SqlDataReader dr1 = data.ExeSqlFillDr(sql1))
            {
                if (dr1.Read())
                {
                    string sql = "update web_admin set UserPassword='******' where username='******'";
                    data.Exesql(sql);
                    WebJS.AlertAndRefresh("修改密码成功,请牢记!");
                }
                else
                {
                    WebJS.AlertAndRefresh("旧密码不正确!");
                }
            }
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Chkadmin.checkadmin("login.aspx");
            string id = Request.QueryString["i"];

            ViewState["id"] = id;
            if (!Page.IsPostBack)
            {
                string   sql  = "select * from teacherinfo where teacher_id=" + id;
                DataBase data = new DataBase();
                using (SqlDataReader dr = data.ExeSqlFillDr(sql))
                {
                    if (dr.Read())
                    {
                        TextName.Text            = dr["name"].ToString();
                        DDLSex.SelectedIndex     = DDLSex.Items.IndexOf(DDLSex.Items.FindByValue(dr["sex"].ToString()));
                        TextAge.Text             = dr["age"].ToString();
                        TextTeacher_Profile.Text = dr["teacher_profile"].ToString();
                    }
                }
            }
        }
Ejemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //if (System.Web.HttpContext.Current.Session["Web_adminUserID"] == null)
     //{
     //    System.Web.HttpContext.Current.Response.Redirect("../cool_login.aspx");
     //}
     //else
     //{
     //    if (System.Web.HttpContext.Current.Session["Web_adminUserID"].ToString() == "")
     //        System.Web.HttpContext.Current.Server.Transfer("../cool_login.aspx");
     //}
     Chkadmin.checkadmin("login.aspx");
     if (!IsPostBack)
     {
         if (Request.QueryString["page"] != null)
         {
             page = Convert.ToInt32(Request.QueryString["page"].ToString());
         }
         Gridadmin.PageIndex           = page;
         Button1.Attributes["onclick"] = "javascript:return confirm('你确认要删除吗?');";
         DatabindKX();
     }
 }
Ejemplo n.º 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Chkadmin.checkadmin("login.aspx");
 }