Пример #1
0
        void Sys_Login_Check(HttpContext context)
        {
            string LoginName     = StringHelper.NullToStr(Filter.FilterData(context.Request["LoginName"]));
            string LoginPassword = StringHelper.NullToStr(Filter.FilterData(context.Request["LoginPassword"]));
            string SecretCode    = StringHelper.NullToStr(Filter.FilterData(context.Request["SecretCode"]));
            string retMsg        = "";

            if (SecretCode != "123456")
            {
                retMsg = "error01";
                context.Response.Write(retMsg);
                context.Response.End();
            }

            string tableName = "Sys_Admin";
            string sqlWhere  = " and AUserName='******' and APassWord='******'";
            string showField = "top 1 Id,DutyID";

            DataTable dt = new HoneyWell.BLL.Sys_Public().SelectData(showField, tableName, sqlWhere).Tables[0];

            if (dt != null && dt.Rows.Count > 0)
            {
                HttpCookie cookie = new HttpCookie("Fadmin");
                cookie["DutyId"]   = dt.Rows[0]["DutyID"].ToString();
                cookie["UserName"] = LoginName;
                cookie["PassWord"] = LoginPassword;
                HttpContext.Current.Response.Cookies.Add(cookie);


                HoneyWell.Model.Sys_Logs logs = new HoneyWell.Model.Sys_Logs();
                logs.ID         = 0;
                logs.DutyId     = Utils.ToInt(dt.Rows[0]["DutyID"].ToString());
                logs.LoginName  = LoginName;
                logs.TitleName  = "用户登录";
                logs.Depicts    = "系统后台登陆,会员名为:" + LoginName + "";
                logs.CreateTime = DateTime.Now;
                logs.IpAddress  = HttpContext.Current.Request.UserHostAddress;
                logs.MoreCol1   = "";
                logs.MoreCol2   = "";
                new HoneyWell.BLL.Sys_Logs().Add(logs);

                retMsg = "success";
                context.Response.Write(retMsg);
                context.Response.End();
            }
            else
            {
                retMsg = "error02";
                context.Response.Write(retMsg);
                context.Response.End();
            }
        }
Пример #2
0
 protected void rptLoop_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         if (e.CommandName == "del")
         {
             HoneyWell.Model.Sys_Product info = new HoneyWell.BLL.Sys_Product().GetModel(Convert.ToInt32(e.CommandArgument));
             HoneyWell.Model.Sys_Logs    logs = new HoneyWell.Model.Sys_Logs();
             logs.ID         = 0;
             logs.DutyId     = Utils.ToInt(GetDutyId());
             logs.LoginName  = GetUserName();
             logs.TitleName  = "产品管理";
             logs.Depicts    = "删除产品信息,名称为:" + info.PName + "";
             logs.CreateTime = DateTime.Now;
             logs.IpAddress  = Request.UserHostAddress;
             logs.MoreCol1   = "";
             logs.MoreCol2   = "";
             new HoneyWell.BLL.Sys_Logs().Add(logs);
             new HoneyWell.BLL.Sys_Public().Delete("Sys_Product", " ID=" + Convert.ToInt32(e.CommandArgument) + "");
             ScriptManager.RegisterClientScriptBlock(rptLoop, GetType(), "", "alert('操作成功!');location.href='sys_Product_List.aspx?Pageindex=" + Encrypt.PageSecuityParam(MyPager.Pageindex.ToString()) + "&Ptypemain=" + hfPTypeMain.Value + "&Ptypesmall=" + hfPTypeSmall.Value + "&Pname=" + txt_PName.Value.Trim() + "&Precommend=" + txt_PRecommend.SelectedValue.Trim() + "&Pshelf=" + txt_PShelf.SelectedValue.Trim() + "';", true);
         }
     }
 }
Пример #3
0
 protected void rptLoop_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         if (e.CommandName == "del")
         {
             HoneyWell.Model.Sys_Focus info = new HoneyWell.BLL.Sys_Focus().GetModel(Convert.ToInt32(e.CommandArgument));
             HoneyWell.Model.Sys_Logs  logs = new HoneyWell.Model.Sys_Logs();
             logs.ID         = 0;
             logs.DutyId     = Utils.ToInt(GetDutyId());
             logs.LoginName  = GetUserName();
             logs.TitleName  = "焦点图列表";
             logs.Depicts    = "删除焦点图信息,名称为:" + info.FName + "";
             logs.CreateTime = DateTime.Now;
             logs.IpAddress  = Request.UserHostAddress;
             logs.MoreCol1   = "";
             logs.MoreCol1   = "";
             new HoneyWell.BLL.Sys_Logs().Add(logs);
             new HoneyWell.BLL.Sys_Public().Delete("Sys_Focus", " ID=" + Convert.ToInt32(e.CommandArgument) + "");
             ScriptManager.RegisterClientScriptBlock(rptLoop, GetType(), "", "alert('操作成功!');location.href='sys_Focus_List.aspx?Code=" + txt_FCode.Value.Trim() + "&Name=" + txt_FName.Value.Trim() + "&Pageindex=" + MyPager.Pageindex + "';", true);
         }
     }
 }