Ejemplo n.º 1
0
    //保存
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"] == null)
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        HyCategory HyCategory = new HyCategory();
        HyCommon HyCommon = new HyCommon();

        HyCategory.CID = this.txtcid.Text;
        HyCategory.hy_cname = this.txtcname.Text;
        HyCategory.hy_csort = System.Int32.Parse(this.txtcsort.Text);
        HyCategory.hy_ctype = "0";
        HyCategory.hy_byzd1 = "";
        HyCategory.hy_byzd2 = "";
        HyCategory.hy_byzd3 = "";
        HyCategory.hy_byzd4 = "";
        if (this.txtop.Value == "add")
        {
            //写系统日志
            HyCommon.WriteLog("新增", "新增类别记录[id:" + this.txtcid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString());

            HyCategory.Insert();
        }
        else
        {
            //写系统日志
            HyCommon.WriteLog("修改", "修改类别记录[id:" + this.txtcid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString());

            HyCategory.Update();
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
Ejemplo n.º 2
0
    //批量删除
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        HyCommon HyCommon = new HyCommon();
        HyContent HyContent = new HyContent();
        string ls_tip = "删除成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                //删除记录
                HyContent.ID = int.Parse(id);
                HyContent.Delete();

            }
        }
        string pageUrl = HyCommon.CombUrlTxt("list_content.aspx", "page={0}&rnd={1}&cid={2}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid_url.Text + "");

        //写系统日志
        HyCommon.WriteLog("删除", "批量删除文章记录", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Ejemplo n.º 3
0
 protected void btn_save_Click(object sender, EventArgs e)
 {
     dt_expert dt_expert = new dt_expert();
     dt_expert.ID = this.txtDocid.Value;
     dt_expert.dt_type = this.txtdt_type.Value;
     dt_expert.dt_name = this.txtdt_name.Text;
     dt_expert.dt_email = this.txtdt_email.Text;
     dt_expert.dt_phone = this.txtdt_phone.Text;
     dt_expert.dt_address = this.txtdt_address.Text;
     dt_expert.dt_summary = this.txtdt_summary.Value;
     dt_expert.field = "";
     if (this.txtop.Value == "add")
     {
         dt_expert.Add();
     }
     else if (this.txtop.Value == "modify")
     {
         dt_expert.ID = this.txtDocid.Value;
         dt_expert.Update();
     }
     //写日志
     HyCommon HyCommon = new HyCommon();
     HyCommon.WriteLog("修改", "修改文章记录[id:" + this.txtDocid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());
     //提示并跳转
     ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>success();</script>");
 }
Ejemplo n.º 4
0
 //批量删除
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyCommon HyCommon = new HyCommon();
     HyUser Hyuser = new HyUser();
     string ls_tip = "删除成功!";
     String[] v_uids = this.txtuids.Value.Split(',');
     for (int i = 0; i < v_uids.Length; i++)
     {
         Hyuser.id = v_uids[i];
         Hyuser.Deletebyid();
     }
     string pageUrl = HyCommon.CombUrlTxt("list_user.aspx", "page={0}&rnd={1}", "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "");
     //写系统日志
     HyCommon.WriteLog("删除", "批量删除用户记录", Session["uid"].ToString(), Session["uname"].ToString());
     Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
 }
Ejemplo n.º 5
0
 protected void btn_save_Click(object sender, EventArgs e)
 {
     question question = new question();
     question.id = this.txtDocid.Value;
     question.GetModel(this.txtDocid.Value);
     question.questioner = this.txtName.Value;
     question.quertionerEmail = this.txtEmail.Value;
     question.describe = this.txtDetail.Value;
     question.field = this.txtdt_summary.Value;
     question.Update();
     //写日志
     HyCommon HyCommon = new HyCommon();
     HyCommon.WriteLog("修改", "修改文章记录[id:" + this.txtDocid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());
     //提示并跳转
     ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>success();</script>");
 }
Ejemplo n.º 6
0
 //删除
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyCommon HyCommon = new HyCommon();
     string pageUrl = HyCommon.CombUrlTxt(ls_url, "page={0}&rnd={1}", page.ToString(), System.Guid.NewGuid().ToString());
     string ls_tip = "删除成功!";
     String[] v_uids = this.txtuids.Value.Split(',');
     HyRole HyRole = new HyRole();
     for (int i = 0; i < v_uids.Length; i++)
     {
         HyRole.hy_roleid = v_uids[i];
         HyRole.Delete();
     }
     //写系统日志
     HyCommon.WriteLog("删除", "删除机构记录", Session["uid"].ToString(), Session["uname"].ToString());
     Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
 }
Ejemplo n.º 7
0
 protected void btn_submit_Click(object sender, EventArgs e)
 {
     String pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(this.pwd.Text, "MD5");
     HyUser HyUser = new HyUser();
     HyCommon HyCommon = new HyCommon();
     if (Session["SESSION_CODE"].ToString().ToLower().Equals(this.txtCode.Text.ToLower()))
     {
         if (HyUser.Login(this.user.Text, pwd))
         {
             DataTable dt = HyUser.Getuserbyuserid(this.user.Text);
             if (dt.Rows.Count > 0)
             {
                 Session["uid"] = dt.Rows[0]["hy_userid"].ToString();
                 Session["uname"] = dt.Rows[0]["hy_username"].ToString();
                 Session["deptid"] = dt.Rows[0]["hy_deptid"].ToString();
             }
             //写系统日志
             string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
             if (userip == null || userip == "")
             {
                 userip = Request.ServerVariables["REMOTE_ADDR"];
             }
             //写系统日志
             HyCommon.WriteLog("登录", "系统登录", Session["uid"].ToString(), Session["uname"].ToString());
             //跳转到首页
             Response.Redirect(lblurl.Text);
         }
         else
         {
             Response.Write("<script>alert('输入的用户名或者密码不正确!');window.location.href = window.location.href;</script>");
         }
     }
     else
     {
         Response.Write("<script>alert('输入的验证码不正确!');window.location.href = window.location.href;</script>");
     }
 }
Ejemplo n.º 8
0
    //保存
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        HyUser Users = new HyUser();
        String password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtoldpwd.Text, "MD5");
        if (!Users.Login(this.txtUid.Text, password))
        {
            this.Response.Write("<script language=javascript>alert('输入旧密码不正确!')</script>");
            return;
        }

        String newpwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtnewpwd.Text, "MD5");

        if (Users.DoChPwd(this.txtUid.Text, newpwd))
        {
            //写系统日志
            HyCommon HyCommon = new HyCommon();
            HyCommon.WriteLog("修改密码", "修改密码", this.txtUid.Text, this.txtUname.Text);
            this.Response.Write("<script language=javascript>alert('修改密码成功!');window.location='main_xgmm.aspx?rnd=" + System.Guid.NewGuid().ToString() + "';</script>");
        }
        else
        {
            this.Response.Write("<script language=javascript>alert('修改密码失败!');window.location='main_xgmm.aspx?rnd=" + System.Guid.NewGuid().ToString() + "';</script>");
        }
    }