コード例 #1
0
ファイル: IndexAjax.ashx.cs プロジェクト: evelh/Done
        /// <summary>
        /// 清除浏览历史
        /// </summary>
        public void ClearHistory(HttpContext context)
        {
            var result = false;

            result = new IndexBLL().ClearHistory(LoginUserId);
            context.Response.Write(new Tools.Serialize().SerializeJson(result));
        }
コード例 #2
0
ファイル: IndexAjax.ashx.cs プロジェクト: evelh/Done
        /// <summary>
        /// 删除选中的书签
        /// </summary>
        public void DeleteChooseBook(HttpContext context)
        {
            var ids    = context.Request.QueryString["ids"];
            var result = new IndexBLL().DeleteBookByIds(ids, LoginUserId);

            context.Response.Write(new Tools.Serialize().SerializeJson(result));
        }
コード例 #3
0
ファイル: IndexAjax.ashx.cs プロジェクト: evelh/Done
        /// <summary>
        /// 书签管理
        /// </summary>
        public void BookMarkManage(HttpContext context)
        {
            var url    = context.Request.QueryString["url"];
            var title  = context.Request.QueryString["title"];
            var result = new IndexBLL().BookMarkManage(url, title, LoginUserId);

            context.Response.Write(new Tools.Serialize().SerializeJson(result));
        }
コード例 #4
0
ファイル: IndexAjax.ashx.cs プロジェクト: evelh/Done
        /// <summary>
        /// 是否下次登陆继续通知
        /// </summary>
        public void ChangeNoticeNext(HttpContext context)
        {
            var result   = false;
            var noticeId = context.Request.QueryString["id"];
            var isAlert  = context.Request.QueryString["isAlert"] == "1";

            if (!string.IsNullOrEmpty(noticeId))
            {
                result = new IndexBLL().ChangeNoticeNext(long.Parse(noticeId), LoginUserId, isAlert);
            }
            context.Response.Write(new Tools.Serialize().SerializeJson(result));
        }
コード例 #5
0
ファイル: IndexAjax.ashx.cs プロジェクト: evelh/Done
        /// <summary>
        /// 获取浏览历史
        /// </summary>
        public void LoadBrowerHistory(HttpContext context)
        {
            var hisList = new IndexBLL().GetHistoryList(LoginUserId);

            if (hisList != null && hisList.Count > 0)
            {
                if (hisList.Count >= 50)
                {
                    hisList = hisList.Take(50).ToList();
                }
                context.Response.Write(new Tools.Serialize().SerializeJson(hisList));
            }
        }
コード例 #6
0
ファイル: IndexAjax.ashx.cs プロジェクト: evelh/Done
        /// <summary>
        /// 根据URL 获取相应书签
        /// </summary>
        void GetBookByUrl(HttpContext context)
        {
            string url = context.Request.QueryString["url"];

            if (!string.IsNullOrEmpty(url))
            {
                var thisBook = new IndexBLL().GetSingBook(url, LoginUserId);
                if (thisBook != null)
                {
                    WriteResponseJson(thisBook);
                    return;
                }
            }
            WriteResponseJson("error");
        }
コード例 #7
0
ファイル: IndexAjax.ashx.cs プロジェクト: evelh/Done
        /// <summary>
        /// 删除全部书签
        /// </summary>
        public void DeleteAllBook(HttpContext context)
        {
            var result = new IndexBLL().DeleteAllBook(LoginUserId);

            context.Response.Write(new Tools.Serialize().SerializeJson(result));
        }
コード例 #8
0
    //private void BindLanguage()
    //{
    //    SqlDataReader reader =DAL.DBHelper.ExecuteReader("SELECT ID,name,languageCode,languageRemark FROM language ORDER BY NAME DESC");
    //    string languageId = "";
    //    string languageName = "";
    //    this.ddlLanguage.Items.Clear();
    //    while (reader.Read())
    //    {
    //        languageId = reader["id"].ToString();
    //        languageName = reader["NAME"].ToString();
    //        this.ddlLanguage.Items.Add(new ListItem(languageName, languageId));
    //    }
    //    reader.Close();
    //    string LanguageID = Session["LanguageID"].ToString().Trim().ToLower();
    //    foreach (ListItem li in this.ddlLanguage.Items)
    //    {
    //        if (li.Value.ToLower() == LanguageID)
    //        {
    //            li.Selected = true;
    //        }
    //    }
    //    ddlLanguage_SelectedIndexChanged(null, null);

    //}
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        //if (Application["jinzhi"] != null && this.txtName.Text.Trim() != DAL.DBHelper.ExecuteScalar("select top 1 number from manage where defaultmanager = 1").ToString() && Application["jinzhi"].ToString().IndexOf("G") != -1)
        //{
        //    //Response.Write("<div align=center style='font-size=12px;' >" + System.Configuration.ConfigurationSettings.AppSettings["jsError"].ToString());
        //    //Response.End();
        //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + GetTran("003151", "当前系统禁止登陆") + "')</script>");
        //    return;
        //}
        string manageId = BLL.CommonClass.CommonDataBLL.getManageID(1);

        if (!BlackListBLL.GetSystem("G") && this.txtName.Text.Trim() != manageId)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + GetTran("003151", "当前系统禁止登陆") + "')</script>");
            return;
        }
        //检验
        if (this.txtName.Text.Trim() == "")
        {
            msg = "<script language='javascript'>alert('" + GetTran("005596", "请输入用户名!") + "');</script>";
            return;
        }
        if (this.txtPwd.Text.Trim() == "")
        {
            msg = "<script language='javascript'>alert('" + GetTran("001854", "请输入密码!") + "');</script>";
            return;
        }
        if (this.txtName.Text.Length < 2 || this.txtName.Text.Length > 10)
        {
            msg = "<script language='javascript'>alert('" + GetTran("005598", "用户名必须在3-10位之间!") + "');</script>";
            return;
        }
        if (this.txtPwd.Text.Length < 4 || this.txtPwd.Text.Length > 10)
        {
            msg = "<script language='javascript'>alert(' " + GetTran("005600", "密码必须在6-10位之间!") + "');</script>";
            return;
        }
        if (this.txtValidate.Text.Trim() == "")
        {
            msg = "<script language='javascript'>alert('" + GetTran("005602", "请输入验证码!") + "');</script>";
            return;
        }

        if (Session["ValidateCode"] != null)
        {
            if (Session["ValidateCode"].ToString() == "")
            {
                msg = "<script language='javascript'>top.location.href='index.aspx';</script>";
                return;
            }
        }
        else
        {
            msg = "<script language='javascript'>top.location.href='index.aspx';</script>";
            return;
        }

        if (this.txtValidate.Text.Trim().ToLower() != Session["ValidateCode"].ToString().Trim().ToLower())
        {
            msg = "<script language='javascript'>alert('" + GetTran("005604", "验证码不正确!") + "');</script>";
            return;
        }

        if (BLL.other.Company.BlackListBLL.CheckBlacklistLogin(this.txtName.Text.Trim(), 2, Request.UserHostAddress) && this.txtName.Text.Trim() != manageId)
        {
            msg = "<script>alert('" + GetTran("005606", "对不起,您的登陆权限失效,请与公司联系!") + "');</script>";
            return;
        }

        //if (BlackListBLL.GetLikeAddress(this.txtName.Text.Trim()) && this.txtName.Text.Trim() != manageId)
        //{
        //    msg = "<script>alert('" + GetTran("005606", "对不起,您的登陆权限失效,请与公司联系!") + "');</script>";
        //    return;
        //}

        string ipAddress = Request.ServerVariables["REMOTE_ADDR"].ToString();//客户IP地址

        try
        {
            if (this.txtName.Text.Trim() != manageId && 0 < BlackListBLL.GetLikeIPCount(ipAddress))
            {
                msg = "<script>alert('" + GetTran("005606", "对不起,您的登陆权限失效,请与公司联系!") + "');</script>";
                return;
            }
        }
        catch
        {
            return;
        }
        if (IndexBLL.CheckLogin("Company", txtName.Text.ToLower(), Encryption.Encryption.GetEncryptionPwd(txtPwd.Text, txtName.Text)))
        {
            Session.Remove("Company");
            Session.Remove("Store");
            Session.Remove("Member");
            Session.Remove("Branch");

            if (Session["Default_Currency"] != null)
            {
                Session.Remove("Default_Currency");
            }

            //购物车的session
            Session.Remove("proList");
            Session["page"]          = "first.aspx";
            Session["UserType"]      = "1";
            Session["LoginUserType"] = "manage";
            Session["Company"]       = this.txtName.Text.Trim();
            Session["TopManageID"]   = this.txtName.Text.Trim();
            Session["WTH"]           = BLL.other.Company.WordlTimeBLL.ConvertAddHours();
            //  Session["language"] = "chinese";
            HttpContext.Current.Session["LanguegeSelect"] = "Chinese";

            Session["permission"] = BLL.other.Company.DeptRoleBLL.GetAllPermission(Session["Company"].ToString());
            HttpContext.Current.Session["OperateBh"] = txtName.Text;

            if (Session["DHNumbers"] != null)
            {
                Session["DHNumbers"] = "";
                Session.Remove("DHNumbers");
            }
            int a = IndexBLL.insertLoginLog(this.txtName.Text, Encryption.Encryption.GetEncryptionPwd(txtPwd.Text, txtName.Text), "Company", DateTime.Now.ToUniversalTime(), CommonDataBLL.OperateIP, 1);

            Session["UserLastLoginDate"] = Convert.ToDateTime(IndexBLL.UplostLogin(this.txtName.Text, "1")).AddHours(BLL.other.Company.WordlTimeBLL.ConvertAddHours());

            Session.Timeout = 30;

            Response.Redirect("../Cmain.htm");
        }
        else
        {
            int a = IndexBLL.insertLoginLog(this.txtName.Text, this.txtPwd.Text, "Company", DateTime.Now.ToUniversalTime(), CommonDataBLL.OperateIP, 2);


            msg = "<script language='javascript'>alert('" + GetTran("005607", "用户名或密码不正确!") + "');</script>";
            return;
        }
    }