Beispiel #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            string sql = "update T_STUDENT SET STUDENT_NAME='" + txtName.Text + "','...";//没写完

            if (sh.excuteNonQuery(sql))
            {
                Tool.Alert("修改成功", Page); //没写完
            }
        }
Beispiel #2
0
        protected void lkDel_Click(object sender, EventArgs e)
        {
            LinkButton lbt = (LinkButton)sender;

            object[] arg  = lbt.CommandArgument.ToString().Split(',');
            string   arg0 = arg[0].ToString();
            string   arg1 = arg[1].ToString();

            string sql = "UPDATE STUDENTAPPLY SET FLAG=2 WHERE STUDENT_NO='" + arg0 + "' and CREATETIME='" + arg1 + "' and FLAG=1";

            if (sh.excuteNonQuery(sql))
            {
                Tool.Alert("批准成功", Page);
                BindRepList();
            }
            else
            {
                Tool.Alert("批准成功", Page);
            }
        }
Beispiel #3
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            sqlHelper sh = new sqlHelper();

            string sno      = Labelno.Text.Trim();
            string sname    = Labelsname.Text.Trim();
            string teacher  = Labeltname.Text.Trim();
            string stuRea   = txtRea.Text.Trim();
            string stuPhone = txtPhone.Text.Trim();
            string Length   = txtLength.Text.Trim();

            //string stuSex


            if (stuRea.Equals(""))
            {
                Tool.Alert("理由不能为空", Page);
            }
            else if (stuPhone.Equals(""))
            {
                Tool.Alert("电话号码不能为空", Page);
            }
            else if (Length.Equals(""))
            {
                Tool.Alert("请假天数不能为空", Page);
            }
            else
            {
                string sqlAddAPPLY = "insert into STUDENTAPPLY(STUDENT_NO,STUDENT_NAME,TEACHER,STUDENT_REA,STUDENT_PHONE,CREATETIME,LENGTH,FLAG) values('" +
                                     sno + "','" + sname + "','" + teacher + "','" + stuRea + "','" + stuPhone + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + Length + "','" + 1 + "')";

                if (sh.excuteNonQuery(sqlAddAPPLY))
                {
                    Tool.Alert("申请成功,请等待回复!", Page);
                    Labelno.Text    = "";
                    Labelsname.Text = "";
                    Labeltname.Text = "";
                    txtRea.Text     = "";
                    txtPhone.Text   = "";
                    txtLength.Text  = "";
                }
                else
                {
                    Tool.Alert("申请失败,请重试!", Page);
                }
            }
        }
Beispiel #4
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            sqlHelper sh = new sqlHelper();

            string strCmd = "select * from userslogin where username='******' and password='******'";
            bool flag = sh.excuteReader(strCmd);

            if (flag)
            {
                DataTable dt = sh.GetList(strCmd).Tables[0];
                if (txtPassword1.Text != "" && txtPassword1.Text != "")
                {
                    if (int.Parse(txtPassword1.Text) == int.Parse(txtPassword.Text))
                    {
                        Response.Write("<script>alert('和原密码相同,修改失败!')</script>");
                    }
                    else if (int.Parse(txtPassword1.Text) != int.Parse(txtPassword2.Text))
                    {
                        Response.Write("<script>alert('密码不一致!')</script>");
                    }
                    else
                    {
                        string sql = "update userslogin set password='******'where username ='******'";
                        if (sh.excuteNonQuery(sql))
                        {
                            Response.Write("<script>alert('修改成功');window.location='login.aspx';</script>");
                        }
                    }
                }
                else
                {
                    Response.Write("<script>alert('修改值不能为空!')</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('用户名或密码错误!')</script>");
            }
        }