コード例 #1
0
    protected void iBtnLogin_Click(object sender, ImageClickEventArgs e)
    {
        if ("".Equals(this.txtUsername.Text))
        {
            NewMessage("请先输入用户名!");
            return;
        }
        if ("".Equals(this.txtPassword.Text))
        {
            NewMessage("请先输入密码!");
            return;
        }
        if (!CheckCode())
        {
            return;
        }
        String UserName        = this.txtUsername.Text;
        String ConfirmPassword = Names.EncryptPassword(this.txtPassword.Text);

        if (UserLogin(UserName, ConfirmPassword))
        {
            InfoStruct.LoginForm LoginForm = new InfoStruct.LoginForm();
            LoginForm.userName           = UserName;
            LoginForm.passWord           = ConfirmPassword;
            Session[Names.SessionManage] = LoginForm;
            string strSql = "UPDATE T_WEBMANAGE SET LASTLOGINTIME = SYSDATE,LASTLOGINIP = '" + GetClientIP() + "' WHERE USERNAME = '******'";
            PersistenceLayer.Query.ProcessSqlNonQuery(strSql, Names.DBName);
            Response.Redirect("Default.aspx");
        }
        else
        {
            ClientScript.RegisterStartupScript(GetType(), "error_script", "<script>alert('用户名或者密码错误。');</script>");
        }
    }
コード例 #2
0
ファイル: wlEdit.aspx.cs プロジェクト: lvxiangjun1/hqweb
    protected void btnOK_Click(object sender, EventArgs e)
    {
        T_NEWSBASEEntity t = new T_NEWSBASEEntity();

        t.ID       = Convert.ToDecimal(Names.GetSingQuote(hidId.Value));
        t.TITLE    = Names.GetSingQuote(txtTITLE.Text);
        t.CONTENT  = Names.GetSingQuote(txtContent.Value);
        t.SUBTITLE = txtSUBTITLE.Text;
        InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm();
        newloginform     = (InfoStruct.LoginForm)Session[Names.SessionManage];
        t.UPDATEUSERNAME = newloginform.userName;


        if (!string.IsNullOrEmpty(txtPUBLISHTIME.Text))
        {
            t.PUBLISHTIME = Convert.ToDateTime(txtPUBLISHTIME.Text);
        }
        List <string> lNAME  = new List <string>();
        List <string> lVALUE = new List <string>();

        t.DEFAULTPICURL = txtDefaultPicUrl.Text.Trim();
        if (b.EditNews(t, lNAME, lVALUE))
        {
            MessageBox("提交成功!");
            Response.Redirect("wlList.aspx");
        }
        else
        {
            MessageBox("提交失败!");
        }
    }
コード例 #3
0
ファイル: ADEdit.aspx.cs プロジェクト: lvxiangjun1/hqweb
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     try{
         string  TITLE     = Names.GetSingQuote(txtTITLE.Text);
         string  INTRODUCE = Names.GetSingQuote(txtINTRODUCE.Text);
         string  PICURL    = Names.GetSingQuote(txtPicPath.Text);
         decimal PICWIDTH  = Convert.ToDecimal(Names.GetSingQuote(txtPICWIDTH.Text));
         decimal PICHEIGHT = Convert.ToDecimal(Names.GetSingQuote(txtPICHEIGHT.Text));
         string  WEBURL    = Names.GetSingQuote(txtWEBURL.Text);
         InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm();
         newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage];
         string  USERNAME = newloginform.userName;
         decimal ADVTYPE  = Convert.ToDecimal(Names.GetSingQuote(ddlADVTYPE.SelectedValue));
         decimal POSITION = Convert.ToDecimal(Names.GetSingQuote(ddlPOSITION.SelectedValue));
         decimal TOPPIX   = Convert.ToDecimal(Names.GetSingQuote(txtTOPPIX.Text));
         string  sql      = "update T_ADVERTISMENT set  TITLE='" + TITLE + "',INTRODUCE='" + INTRODUCE + "',PICURL='" + PICURL + "',PICWIDTH=" + PICWIDTH + ",PICHEIGHT=" + PICHEIGHT + ",WEBURL='" + WEBURL + "',USERNAME='******',ADVTYPE=" + ADVTYPE + ",POSITION=" + POSITION + ",TOPPIX=" + TOPPIX + " where ID =" + hdID.Value;
         if (Query.ProcessSqlNonQuery(sql, Names.DBName) > 0)
         {
             MessageBox("修改成功!");
             Response.Redirect("ADList.aspx");
         }
         else
         {
             MessageBox("修改失败!");
         }
     }catch {
         MessageBox("修改失败!");
     }
 }
コード例 #4
0
ファイル: lkAdd.aspx.cs プロジェクト: lvxiangjun1/hqweb
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        T_NEWSBASEEntity t = new T_NEWSBASEEntity();

        t.NODEID = 45;
        t.TITLE  = Names.GetSingQuote(txtTITLE.Text);

        t.CONTENT = Names.GetSingQuote(txtContent.Value);
        InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm();
        newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage];
        t.USERNAME   = newloginform.userName;
        t.STATUS     = 0;

        if (!string.IsNullOrEmpty(txtPUBLISHTIME.Text))
        {
            t.PUBLISHTIME = Convert.ToDateTime(txtPUBLISHTIME.Text);
        }
        List <string> lNAME  = new List <string>();
        List <string> lVALUE = new List <string>();

        try
        {
            t.DEFAULTPICURL = Request.Form["uploadList"];
        }
        catch { }
        if (b.AddNews(t, lNAME, lVALUE))
        {
            MessageBox("提交成功!");
            Response.Redirect("lkList.aspx");
        }
        else
        {
            MessageBox("提交失败!");
        }
    }
コード例 #5
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     try{
         string  TITLE     = Names.GetSingQuote(txtTITLE.Text);
         string  INTRODUCE = Names.GetSingQuote(txtINTRODUCE.Text);
         string  PICURL    = Names.GetSingQuote(txtPicPath.Text);
         decimal PICWIDTH  = Convert.ToDecimal(Names.GetSingQuote(txtPICWIDTH.Text));
         decimal PICHEIGHT = Convert.ToDecimal(Names.GetSingQuote(txtPICHEIGHT.Text));
         string  WEBURL    = Names.GetSingQuote(txtWEBURL.Text);
         InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm();
         newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage];
         string  USERNAME = newloginform.userName;
         decimal ADVTYPE  = Convert.ToDecimal(Names.GetSingQuote(ddlADVTYPE.SelectedValue));
         decimal POSITION = Convert.ToDecimal(Names.GetSingQuote(ddlPOSITION.SelectedValue));
         decimal TOPPIX   = Convert.ToDecimal(Names.GetSingQuote(txtTOPPIX.Text));
         string  sql      = "insert into T_ADVERTISMENT(ID,TITLE,INTRODUCE,PICURL,PICWIDTH,PICHEIGHT,WEBURL,USERNAME,INSERTTIME,ISDELETE,DELETETIME,DELETENAME,ADVTYPE,POSITION,TOPPIX) values(" + Sequence.GetNextValue("SEQ_T_ADVERTISMENT").ToString() + ",'" + TITLE + "','" + INTRODUCE + "','" + PICURL + "'," + PICWIDTH + "," + PICHEIGHT + ",'" + WEBURL + "','" + USERNAME + "',sysdate,'N','',''," + ADVTYPE + ", " + POSITION + "," + TOPPIX + ")";
         if (Query.ProcessSqlNonQuery(sql, Names.DBName) > 0)
         {
             MessageBox("提交成功!");
             Response.Redirect("ADList.aspx");
         }
         else
         {
             MessageBox("提交失败!");
         }
     }catch {
         MessageBox("提交失败!");
     }
 }
コード例 #6
0
ファイル: newsAdd.aspx.cs プロジェクト: lvxiangjun1/hqweb
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        //if (txtTITLE.Text == ""){ MessageBox("标题不能为空"); }
        //else
        //{
        //if (txtPUBLISHTIME.Text == "") { MessageBox("更新时间不能为空"); }
        //else
        //{ }
        T_NEWSBASEEntity t = new T_NEWSBASEEntity();

        t.NODEID = 3;
        t.TITLE  = Names.GetSingQuote(txtTITLE.Text);

        t.TITLEFONT     = Names.GetSingQuote(ddlTITLEFONT.SelectedValue);
        t.TITLECOLOR    = Names.GetSingQuote(ddlTITLECOLOR.SelectedValue);
        t.TITLESIZE     = Convert.ToDecimal(Names.GetSingQuote(ddlTITLESIZE.SelectedValue));
        t.SUBTITLE      = Names.GetSingQuote(txtSUBTITLE.Text);
        t.SUBTITLEFONT  = Names.GetSingQuote(ddlSUBTITLEFONT.SelectedValue);
        t.SUBTITLECOLOR = Names.GetSingQuote(ddlSUBTITLECOLOR.SelectedValue);
        t.SUBTITLESIZE  = Convert.ToDecimal(Names.GetSingQuote(ddlSUBTITLESIZE.SelectedValue));
        t.COPYRIGHT     = Names.GetSingQuote(txtCOPYRIGHT.Text);
        t.AUTHOR        = Names.GetSingQuote(txtAUTHOR.Text);
        t.CONTENT       = Names.GetSingQuote(txtContent.Value);
        InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm();
        newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage];
        t.USERNAME   = newloginform.userName;
        t.STATUS     = 0;
        t.ISSPECIAL  = Names.GetSingQuote(ddlISSPECIAL.SelectedValue);
        if (!string.IsNullOrEmpty(txtPUBLISHTIME.Text))
        {
            t.PUBLISHTIME = Convert.ToDateTime(txtPUBLISHTIME.Text);
        }
        List <string> lNAME  = new List <string>();
        List <string> lVALUE = new List <string>();

        try
        {
            t.DEFAULTPICURL = Request.Form["uploadList"];
            string[] uploadListValue = Regex.Split(hiduploadListValue.Text, "&&", RegexOptions.IgnoreCase);
            string[] uploadListText  = Regex.Split(hiduploadListText.Text, "&&", RegexOptions.IgnoreCase);
            for (int i = 0; i < uploadListValue.Length - 1; i++)
            {
                lNAME.Add(Names.GetSingQuote(uploadListText[i]));
                lVALUE.Add(Names.GetSingQuote(uploadListValue[i]));
            }
        }
        catch { }
        if (b.AddNews(t, lNAME, lVALUE))
        {
            MessageBox("提交成功!");
            Response.Redirect("NewsList.aspx");
        }
        else
        {
            MessageBox("提交失败!");
        }
    }
コード例 #7
0
 void BasePage_Load(Object sender, EventArgs e)
 {
     if (Session[Names.SessionManage] == null)
     {
         Response.Redirect("~/background/adminLogin.aspx");
     }
     else
     {
         InfoStruct.LoginForm newloginForm = new InfoStruct.LoginForm();
         newloginForm = (InfoStruct.LoginForm)Session[Names.SessionManage];
         BaseUserName = newloginForm.userName;
     }
 }
コード例 #8
0
ファイル: admin_top.aspx.cs プロジェクト: lvxiangjun1/hqweb
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         dateshow.InnerHtml = "今天是" + DateTime.Now.ToString("yyyy年MM月dd天HH时mm分") + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
         InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm();
         if (Session[Names.SessionManage] != null)
         {
             newloginform           = (InfoStruct.LoginForm)Session[Names.SessionManage];
             usernameshow.InnerHtml = "欢迎您!" + newloginform.userName;
         }
     }
 }
コード例 #9
0
ファイル: dtEdit.aspx.cs プロジェクト: lvxiangjun1/hqweb
    protected void btnOK_Click(object sender, EventArgs e)
    {
        T_NEWSBASEEntity t = new T_NEWSBASEEntity();

        t.ID    = Convert.ToDecimal(Names.GetSingQuote(hidId.Value));
        t.TITLE = Names.GetSingQuote(txtTITLE.Text);



        t.COPYRIGHT = Names.GetSingQuote(txtCOPYRIGHT.Text);
        t.AUTHOR    = Names.GetSingQuote(txtAUTHOR.Text);
        t.CONTENT   = Names.GetSingQuote(txtContent.Value);

        InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm();
        newloginform     = (InfoStruct.LoginForm)Session[Names.SessionManage];
        t.UPDATEUSERNAME = newloginform.userName;



        if (!string.IsNullOrEmpty(txtPUBLISHTIME.Text))
        {
            t.PUBLISHTIME = Convert.ToDateTime(txtPUBLISHTIME.Text);
        }
        List <string> lNAME  = new List <string>();
        List <string> lVALUE = new List <string>();

        try
        {
            t.DEFAULTPICURL = Request.Form["uploadList"];
            string[] uploadListValue = Regex.Split(hiduploadListValue.Text, "&&", RegexOptions.IgnoreCase);
            string[] uploadListText  = Regex.Split(hiduploadListText.Text, "&&", RegexOptions.IgnoreCase);
            for (int i = 0; i < uploadListValue.Length - 1; i++)
            {
                lNAME.Add(Names.GetSingQuote(uploadListText[i]));
                lVALUE.Add(Names.GetSingQuote(uploadListValue[i]));
            }
        }
        catch { }

        if (b.EditNews(t, lNAME, lVALUE))
        {
            MessageBox("提交成功!");
            Response.Redirect("dtList.aspx");
        }
        else
        {
            MessageBox("提交失败!");
        }
    }
コード例 #10
0
ファイル: spAdd.aspx.cs プロジェクト: lvxiangjun1/hqweb
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        T_NEWSBASEEntity t = new T_NEWSBASEEntity();

        t.NODEID        = 4;
        t.TITLE         = Names.GetSingQuote(txtTITLE.Text);
        t.TITLEFONT     = Names.GetSingQuote(ddlTITLEFONT.SelectedValue);
        t.TITLECOLOR    = Names.GetSingQuote(ddlTITLECOLOR.SelectedValue);
        t.TITLESIZE     = Convert.ToDecimal(Names.GetSingQuote(ddlTITLESIZE.SelectedValue));
        t.SUBTITLE      = Names.GetSingQuote(txtSUBTITLE.Text);
        t.SUBTITLEFONT  = Names.GetSingQuote(ddlSUBTITLEFONT.SelectedValue);
        t.SUBTITLECOLOR = Names.GetSingQuote(ddlSUBTITLECOLOR.SelectedValue);
        t.SUBTITLESIZE  = Convert.ToDecimal(Names.GetSingQuote(ddlSUBTITLESIZE.SelectedValue));
        t.COPYRIGHT     = Names.GetSingQuote(txtCOPYRIGHT.Text);
        t.AUTHOR        = Names.GetSingQuote(txtAUTHOR.Text);
        t.CONTENT       = Names.GetSingQuote(txtContent.Value);

        InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm();
        newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage];
        t.USERNAME   = newloginform.userName;
        t.STATUS     = 0;

        if (!string.IsNullOrEmpty(txtPUBLISHTIME.Text))
        {
            t.PUBLISHTIME = Convert.ToDateTime(txtPUBLISHTIME.Text);
        }
        List <string> lNAME  = new List <string>();
        List <string> lVALUE = new List <string>();

        if (b.AddNews(t, lNAME, lVALUE))
        {
            MessageBox("提交成功!");
            Response.Redirect("spList.aspx");
        }
        else
        {
            MessageBox("提交失败!");
        }
    }
コード例 #11
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     InfoStruct.LoginForm newloginform = new InfoStruct.LoginForm();
     if (Session[Names.SessionManage] != null)
     {
         newloginform = (InfoStruct.LoginForm)Session[Names.SessionManage];
         string oldpwd = Names.EncryptPassword(txtoldPassword.Text.Trim());
         if (!oldpwd.Equals(newloginform.passWord))
         {
             MessageBox("请输入正确的原始密码!");
             return;
         }
         if (!txtnewPassword.Text.Trim().Equals(txtcomPassword.Text.Trim()))
         {
             MessageBox("确认密码和新密码请保持一致!");
             return;
         }
         string strSql = "UPDATE T_WEBMANAGE SET PASSWORD = '******' WHERE USERNAME = '******'";
         PersistenceLayer.Query.ProcessSqlNonQuery(strSql, Names.DBName);
         Session[Names.SessionManage] = null;
         MessageBox("密码修改成功,请重新登录!");
         Response.Write("<script type='text/javascript'>javascript:parent.location.href='adminLogin.aspx';</script>");
     }
 }