예제 #1
0
        public static void AddPoint(Lebi_User user, decimal point, int type, Lebi_Administrator admin, string remark)
        {
            Random ran   = new Random();
            string PayNo = Order.CreateOrderCode() + System.DateTime.Now.Millisecond + ran.Next(100000, 999999);

            AddPoint(user, point, type, null, admin, remark, PayNo);
        }
예제 #2
0
        public static void Add(string content, string tablename, string keyid, string description)
        {
            Lebi_User          user  = EX_User.CurrentUser();
            Lebi_Administrator admin = EX_Admin.CurrentAdmin();

            Add(content, tablename, keyid, null, null, null, description);
        }
예제 #3
0
파일: EX_Admin.cs 프로젝트: zwkjgs/LebiShop
 /// <summary>
 /// 判断登录状态
 /// </summary>
 /// <returns></returns>
 public static bool LoginStatus()
 {
     if (HttpContext.Current.Session["admin"] == null)
     {
         var    nv    = CookieTool.GetCookie("Master");
         int    uid   = 0;
         string uhash = "";
         string uname = "";
         if (nv.Count > 1)
         {
             if (!string.IsNullOrEmpty(nv.Get("id")) && !string.IsNullOrEmpty(nv.Get("hash")) && !string.IsNullOrEmpty(nv.Get("name")))
             {
                 //uid = StringUtils.StrToInt(nv.Get("id"), 0);
                 int.TryParse(nv.Get("id"), out uid);
                 uhash = nv.Get("hash");
                 uname = nv.Get("name");
                 Lebi_Administrator master = B_Lebi_Administrator.GetModel(uid);
                 if (CheckAdmin(master, uhash, uname, true))
                 {
                     SetSession(master);
                     return(true);
                 }
                 else
                 {
                     return(false);
                 }
             }
             return(false);
         }
         return(false);
     }
     return(true);
 }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("admin_edit", "编辑系统用户"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Administrator.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Administrator();
                model.Type_id_AdminStatus = 230;
            }
            if (model.Avatar != "")
            {
                ImageUrl  = model.Avatar.Replace("small", "original");
                AvatarUrl = model.Avatar;
            }
            else
            {
                ImageUrl  = WebPath + "/theme/system/systempage/admin/images/Avatar.jpg";
                AvatarUrl = WebPath + "/theme/system/systempage/admin/images/Avatar.jpg";
            }

            groups = B_Lebi_Admin_Group.GetList("", "Sort desc");
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Administrator.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Administrator();
            }

            groups = B_Lebi_Admin_Group.GetList("", "Sort desc");
        }
예제 #6
0
파일: EX_Admin.cs 프로젝트: zwkjgs/LebiShop
 /// <summary>
 /// 验证ID、密码
 /// </summary>
 /// <param name="MasterID"></param>
 /// <param name="PWD"></param>
 /// <returns></returns>
 public static bool CheckAdmin(Lebi_Administrator master, string PWD, string NAME, bool ReadyLogin = true)
 {
     if (master == null)
     {
         return(false);
     }
     else
     {
         string SafeAdminLogin = RequestTool.GetConfigKey("SafeAdminLogin").Trim();
         if (SafeAdminLogin == "")
         {
             SafeAdminLogin = "******";
         }
         if (ReadyLogin == true)
         {
             if (RequestTool.GetConfigKey("DemoSite").Trim() == "1")
             {
                 return(true);
             }
             if (PWD == MD5(master.RandNum + master.Password) && NAME == master.UserName)  //增加随机加密串二次MD5加密 增加安全性 by lebi.kingdge 2015-04-15
             {
                 if (SafeAdminLogin == "1")
                 {
                     if (RequestTool.GetClientIP() != master.IP_This)  //增加IP判断 其他IP要求重新登录 增加安全性 by lebi.kingdge 2015-04-15
                     {
                         return(false);
                     }
                     else
                     {
                         return(true);
                     }
                 }
                 else
                 {
                     return(true);
                 }
             }
         }
         else
         {
             if (PWD == master.Password && NAME == master.UserName)
             {
                 return(true);
             }
         }
         if (master.Type_id_AdminStatus != 230)
         {
             return(false);
         }
     }
     return(false);
 }
예제 #7
0
파일: EX_Admin.cs 프로젝트: zwkjgs/LebiShop
        /// <summary>
        /// 登录成功
        /// </summary>
        /// <param name="master"></param>
        public static void SetSession(Lebi_Administrator master)
        {
            HttpContext.Current.Session["admin"]       = master;
            HttpContext.Current.Session["admin_group"] = B_Lebi_Admin_Group.GetModel("id=" + master.Admin_Group_id + "");
            List <Lebi_Admin_Power> ps = B_Lebi_Admin_Power.GetList("Admin_Group_id=" + master.Admin_Group_id + "", "");

            HttpContext.Current.Session["admin_power"] = (from m in ps
                                                          where m.Url == ""
                                                          select m).ToList();
            HttpContext.Current.Session["admin_power_url"] = (from m in ps
                                                              where m.Url != ""
                                                              select m).ToList();
        }
예제 #8
0
파일: Money.cs 프로젝트: yzbjack/LebiShop
        /// <summary>
        ///
        /// </summary>
        /// <param name="user"></param>
        /// <param name="money"></param>
        /// <param name="type"></param>
        /// <param name="admin"></param>
        /// <param name="description"></param>
        /// <param name="remark"></param>
        /// <param name="fanxian">是否包含返现款消费</param>
        public static void AddMoney(Lebi_User user, decimal money, int type, Lebi_Administrator admin, string description, string remark, bool fanxian = true)
        {
            if (money == 0)
            {
                return;
            }
            Lebi_User_Money mo = new Lebi_User_Money();

            if (admin != null)
            {
                mo.Admin_id       = admin.id;
                mo.Admin_UserName = admin.UserName;
            }
            mo.Money = money;
            mo.Type_id_MoneyStatus = 181;
            mo.Type_id_MoneyType   = type;
            mo.User_id             = user.id;
            mo.User_UserName       = user.UserName;
            mo.User_RealName       = user.RealName;
            mo.Description         = description;
            mo.Remark = remark;



            //string money_ = B_Lebi_User_Money.GetValue("sum(Money)", "User_id=" + user.id + " and Type_id_MoneyStatus=181");
            //decimal Money = 0;
            //Decimal.TryParse(money_, out Money);
            if (type == 195)//返现
            {
                user.Money_fanxian = user.Money_fanxian + money;
            }
            if (type == 192 && fanxian == true)//消费
            {
                user.Money_fanxian = user.Money_fanxian + money;
                if (user.Money_fanxian < 0)
                {
                    user.Money_fanxian = 0;
                }
            }
            user.Money = user.Money + money;
            B_Lebi_User.Update(user);
            mo.Money_after         = user.Money;
            mo.Money_fanxian_after = user.Money_fanxian;
            B_Lebi_User_Money.Add(mo);
            //发送短信
            if (ShopCache.GetBaseConfig().SMS_sendmode.Contains("SMSTPL_balance"))
            {
                SMS.SendSMS_balance(user);
            }
        }
예제 #9
0
        /// <summary>
        /// 编辑管理员
        /// </summary>
        public void Admin_Edit()
        {
            int id = RequestTool.RequestInt("id", 0);
            Lebi_Administrator model = B_Lebi_Administrator.GetModel(id);

            if (model == null)
            {
                if (!EX_Admin.Power("admin_add", "添加系统用户"))
                {
                    AjaxNoPower();
                    return;
                }
                string UserName = RequestTool.RequestSafeString("UserName");
                int    count    = B_Lebi_Administrator.Counts("UserName=lbsql{'" + UserName + "'}");
                if (count > 0)
                {
                    Response.Write("{\"msg\":\"账户已存在\"}");
                    return;
                }
                model = new Lebi_Administrator();
                B_Lebi_Administrator.BindForm(model);
                model.Pro_Type_ids = RequestTool.RequestSafeString("Pro_Type_ids");
                model.Site_ids     = RequestTool.RequestSafeString("Site_ids");
                model.Project_ids  = RequestTool.RequestSafeString("Project_ids");
                string password = RequestTool.RequestSafeString("Password");
                model.Password = EX_Admin.MD5(password);
                B_Lebi_Administrator.Add(model);
                string action      = Tag("添加系统用户");
                string description = model.UserName;
                Log.Add(action, "Administrator", model.id.ToString(), CurrentAdmin, description);
            }
            else
            {
                if (!EX_Admin.Power("admin_edit", "编辑系统用户"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Administrator.BindForm(model);
                model.Pro_Type_ids = RequestTool.RequestString("Pro_Type_ids");
                model.Site_ids     = RequestTool.RequestString("Site_ids");
                B_Lebi_Administrator.Update(model);
                string action      = Tag("编辑系统用户");
                string description = model.UserName;
                Log.Add(action, "Administrator", model.id.ToString(), CurrentAdmin, description);
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
예제 #10
0
        /// <summary>
        /// 管理员用户名称
        /// </summary>
        /// <param name="siteid"></param>
        /// <returns></returns>
        public string AdminName(int id)
        {
            Lebi_Administrator model = B_Lebi_Administrator.GetModel(id);

            if (model == null)
            {
                return("");
            }
            Lebi_Admin_Group group = B_Lebi_Admin_Group.GetModel(model.Admin_Group_id);

            if (group == null)
            {
                return(model.RealName);
            }
            return("[" + Lang(group.Name) + "]" + model.RealName);
        }
예제 #11
0
파일: Log.cs 프로젝트: zwkjgs/LebiShop
        /// <summary>
        /// 添加记录
        /// </summary>
        /// <param name="content"></param>
        /// <param name="tablename"></param>
        /// <param name="keyid"></param>
        public static void Add(string content, Lebi_User user, Lebi_Administrator admin, Lebi_Supplier supplier)
        {
            string res = "time:" + System.DateTime.Now + "\r\n";

            res += "url:" + RequestTool.GetRequestUrlNonDomain() + "\r\n";
            res += "refererurl:" + RequestTool.GetUrlReferrerNonDomain() + "\r\n";
            if (user != null)
            {
                res += "userid:" + user.id + "\r\n";
            }
            if (admin != null)
            {
                res += "adinid:" + admin.id + "\r\n";
            }
            if (supplier != null)
            {
                res += "supplierid:" + supplier.id + "\r\n";
            }
            res += "content:" + content + "\r\n\r\n";
            string Path        = "/systemlog/" + System.DateTime.Now.Year + "/";
            string PhysicsPath = HttpRuntime.AppDomainAppPath + Path;

            try
            {
                if (!Directory.Exists(PhysicsPath))
                {
                    Directory.CreateDirectory(PhysicsPath);
                }
                string PhysicsFileName = PhysicsPath + System.DateTime.Now.ToString("MMdd") + ".txt";
                if (System.IO.File.Exists(PhysicsFileName))
                {
                    FileStream   fs3 = new FileStream(PhysicsFileName, FileMode.Append);
                    StreamWriter sw3 = new StreamWriter(fs3, System.Text.Encoding.GetEncoding("utf-8"));
                    //sw3.WriteLine(""+labeltop.Text.ToString()+"\r\n"+labelmessage.Text.ToString()+"\r\n");
                    StringBuilder sb3 = new StringBuilder();
                    sb3.Append(res);
                    sw3.Write(sb3.ToString());
                    sw3.Close();
                    fs3.Close();
                }
                else
                {
                    HtmlEngine.Instance.WriteFile(PhysicsFileName, res);
                }
            }
            catch (Exception e) { }
        }
예제 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("admin_edit", "编辑系统用户"))
            {
                WindowNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Administrator.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Administrator();
                model.Type_id_AdminStatus = 230;
            }

            groups = B_Lebi_Admin_Group.GetList("", "Sort desc");
        }
예제 #13
0
        /// <summary>
        /// 删除管理员
        /// </summary>
        public void Admin_PWD()
        {
            int id = RequestTool.RequestInt("id", 0);
            Lebi_Administrator model = B_Lebi_Administrator.GetModel(id);

            if (model == null)
            {
                model = CurrentAdmin;
            }

            string PWD1 = RequestTool.RequestString("PWD1");
            string PWD2 = RequestTool.RequestString("PWD2");
            string PWD  = EX_Admin.MD5(PWD1);

            //if (model.id != CurrentAdmin.id)
            //{
            if (!EX_Admin.Power("admin_pwd", "编辑系统用户密码"))
            {
                AjaxNoPower();
                return;
            }
            //}

            if (!EX_Admin.Power("admin_pwd", "编辑系统用户密码"))
            {
                if (PWD != model.Password)
                {
                    Response.Write("{\"msg\":\"原始密码错误\"}");
                    return;
                }
            }

            if (PWD1 != PWD2)
            {
                Response.Write("{\"msg\":\"两次输入的密码不一致\"}");
                return;
            }
            model.Password = PWD;
            B_Lebi_Administrator.Update(model);
            string action      = Tag("编辑系统用户密码");
            string description = model.UserName;

            Log.Add(action, "Administrator", model.id.ToString(), CurrentAdmin, description);
            Response.Write("{\"msg\":\"OK\"}");
        }
예제 #14
0
파일: Point.cs 프로젝트: yzbjack/LebiShop
        public static void AddPoint(Lebi_User user, decimal point, int type, Lebi_Administrator admin, string remark)
        {
            Lebi_User_Point model = new Lebi_User_Point();

            if (admin != null)
            {
                model.Admin_id       = admin.id;
                model.Admin_UserName = admin.UserName;
            }

            model.Type_id_PointStatus = 171;
            model.Point         = point;
            model.Remark        = remark;
            model.Time_Update   = DateTime.Now;
            model.User_id       = user.id;
            model.User_RealName = user.RealName;
            model.User_UserName = user.UserName;
            B_Lebi_User_Point.Add(model);
            UpdateUserPoint(user);
        }
예제 #15
0
        /// <summary>
        /// 编辑管理员头像
        /// </summary>
        public void Admin_Avatar_Edit()
        {
            int id = RequestTool.RequestInt("id", 0);
            Lebi_Administrator model = B_Lebi_Administrator.GetModel(id);

            if (model != null)
            {
                if (!EX_Admin.Power("admin_edit", "编辑系统用户"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Administrator.BindForm(model);
                model.Avatar = RequestTool.RequestSafeString("Avatar");
                B_Lebi_Administrator.Update(model);
                string action      = Tag("编辑系统用户");
                string description = model.UserName + " - " + model.Avatar;
                Log.Add(action, "Administrator", model.id.ToString(), CurrentAdmin, description);
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
예제 #16
0
파일: EX_Admin.cs 프로젝트: zwkjgs/LebiShop
        /// <summary>
        /// 管理员登录
        /// </summary>
        /// <param name="MasterName"></param>
        /// <param name="PWD"></param>
        /// <returns></returns>
        public static bool AdminLogin(string AdminName, string PWD)
        {
            string SafeAdminLogin = RequestTool.GetConfigKey("SafeAdminLogin").Trim();

            if (SafeAdminLogin == "")
            {
                SafeAdminLogin = "******";
            }
            bool ret = false;
            Lebi_Administrator master = B_Lebi_Administrator.GetModel("UserName=lbsql{'" + AdminName + "'} and Type_id_AdminStatus=230");

            if (CheckAdmin(master, PWD, AdminName, false))
            {
                Random Random  = new Random();
                int    RandNum = Random.Next(100000000, 999999999);
                if (SafeAdminLogin == "1")
                {
                    master.RandNum = RandNum;
                    B_Lebi_Administrator.Update(master);
                }
                else
                {
                    RandNum = master.RandNum;
                }
                NameValueCollection nvs = new NameValueCollection();
                nvs.Add("id", master.id.ToString());
                nvs.Add("hash", MD5(RandNum + PWD));
                nvs.Add("name", AdminName);
                CookieTool.WriteCookie("Master", nvs, 365);
                SetSession(master);
                HttpContext.Current.Session["checkCode"] = null;
                ret = true;
                //开启一个线程提交最后登录记录
                Thread thread = new Thread(new ThreadStart(UserLastUse));
                thread.IsBackground = true;//这样能随主程序一起结束
                thread.Start();
            }
            return(ret);
        }
예제 #17
0
        public static void AddMoney(Lebi_User user, decimal money, int type, Lebi_Order order, Lebi_Administrator admin, string description, string remark, bool fanxian = true)
        {
            if (money == 0)
            {
                return;
            }
            if (type == 192 || type == 193)
            {
                if (money > 0)
                {
                    money = 0 - money;
                }
            }
            Lebi_User_Money mo = new Lebi_User_Money();

            if (admin != null)
            {
                mo.Admin_id       = admin.id;
                mo.Admin_UserName = admin.UserName;
            }
            mo.Money = money;
            mo.Type_id_MoneyStatus = 181;
            mo.Type_id_MoneyType   = type;
            mo.User_id             = user.id;
            mo.User_UserName       = user.UserName;
            mo.User_RealName       = user.RealName;
            mo.Description         = description;
            mo.Remark = remark;
            if (order != null)
            {
                mo.Order_id    = order.id;
                mo.Order_Code  = order.Code;
                mo.Order_PayNo = order.PayNo;
            }
            //string money_ = B_Lebi_User_Money.GetValue("sum(Money)", "User_id=" + user.id + " and Type_id_MoneyStatus=181");
            //decimal Money = 0;
            //Decimal.TryParse(money_, out Money);
            if (type == 195)//返现
            {
                user.Money_fanxian = user.Money_fanxian + money;
            }
            if (type == 192 && fanxian == true)//消费
            {
                user.Money_fanxian = user.Money_fanxian + money;
                if (user.Money_fanxian < 0)
                {
                    user.Money_fanxian = 0;
                }
            }
            user.Money = user.Money + money;
            B_Lebi_User.Update(user);
            mo.Money_after         = user.Money;
            mo.Money_fanxian_after = user.Money_fanxian;
            B_Lebi_User_Money.Add(mo);
            //发送短信
            SMS.SendSMS_balance(user);
            //APP推送
            APP.Push_balance(user);
        }
예제 #18
0
파일: EX_Admin.cs 프로젝트: zwkjgs/LebiShop
        public static bool CheckAdmin(int id, string PWD, string NAME)
        {
            Lebi_Administrator master = B_Lebi_Administrator.GetModel(id);

            return(CheckAdmin(master, PWD, NAME));
        }
예제 #19
0
파일: Log.cs 프로젝트: zwkjgs/LebiShop
        public static void Add(string content, string tablename, string keyid, Lebi_User user, Lebi_Administrator admin, Lebi_Supplier supplier, string description)
        {
            string URL        = RequestTool.GetRequestUrlNonDomain();
            string RefererURL = RequestTool.GetUrlReferrerNonDomain();
            Thread thread     = new Thread(() => ThreadAdd(content, tablename, keyid, user, admin, supplier, description, URL, RefererURL));

            thread.IsBackground = true;
            thread.Start();
        }
예제 #20
0
        public void AdminLogin()
        {
            string userName     = RequestTool.RequestString("userName");
            string UserPWD      = RequestTool.RequestString("UserPWD");
            string code         = RequestTool.RequestString("code");
            int    saveusername = RequestTool.RequestInt("saveusername", 0);
            int    type         = RequestTool.RequestInt("type", 0);
            string loginerror   = "false";

            if (SYS.Verifycode_AdminLogin == "1")
            {
                try
                {
                    loginerror = (string)HttpContext.Current.Session["loginerror"];
                }
                catch
                {
                    loginerror = "false";
                }
                if (loginerror == "true")
                {
                    if (CurrentCheckCode != code)
                    {
                        Response.Write(Language.Tag("验证码错误", CurrentLanguage.Code));
                        return;
                    }
                }
            }
            UserPWD = EX_Admin.MD5(UserPWD);
            if (EX_Admin.AdminLogin(userName, UserPWD))
            {
                Lebi_Administrator admin = EX_Admin.CurrentAdmin();
                admin.Time_Last = admin.Time_This;
                admin.IP_Last   = admin.IP_This;
                admin.Time_This = DateTime.Now;
                admin.Count_Login++;
                admin.IP_This = RequestTool.GetClientIP();
                B_Lebi_Administrator.Update(admin);
                Log.Add("登陆系统", "Login", admin.id.ToString(), EX_Admin.CurrentAdmin());
                HttpContext.Current.Session["loginerror"] = "false";
                Response.Cookies.Add(new HttpCookie("AdminLoginError", ""));
                if (saveusername == 1)
                {
                    Response.Cookies.Add(new HttpCookie("saveusername", "1"));
                    Response.Cookies.Add(new HttpCookie("AdminUserName", userName));
                }
                else
                {
                    Response.Cookies.Add(new HttpCookie("saveusername", ""));
                    Response.Cookies.Add(new HttpCookie("AdminUserName", ""));
                }
                if (type == 1)
                {
                    site = new Site();
                    string url = "<script type=\"text/javascript\">window.location='" + site.AdminPath + "/default.aspx';</script>";
                    Response.Write(url);
                    Response.End();
                }
                else
                {
                    Response.Write("OK");
                }
                return;
            }
            if (SYS.Verifycode_AdminLogin == "1")
            {
                HttpContext.Current.Session["loginerror"] = "true";
            }
            Log.Add("登陆系统", "Login", "", EX_Admin.CurrentAdmin(), "[" + userName + "]用户名或密码错误");
            Response.Write(Language.Tag("用户名或密码错误", CurrentLanguage.Code));
            return;
        }
예제 #21
0
        public static void AddPoint(Lebi_User user, decimal point, int type, Lebi_Order order, Lebi_Administrator admin, string remark, string PayNo)
        {
            bool            addflag = false;
            Lebi_User_Point model   = new Lebi_User_Point();

            if (string.IsNullOrEmpty(PayNo))
            {
                Random ran = new Random();
                PayNo = Order.CreateOrderCode() + System.DateTime.Now.Millisecond + ran.Next(100000, 999999);
            }
            model = B_Lebi_User_Point.GetModel("Order_PayNo = lbsql{'" + PayNo + "'}");
            if (model == null)
            {
                model   = new Lebi_User_Point();
                addflag = true;
            }
            if (admin != null)
            {
                model.Admin_id       = admin.id;
                model.Admin_UserName = admin.UserName;
            }
            if (order != null)
            {
                model.Order_id   = order.id;
                model.Order_Code = order.Code;
            }
            model.Order_PayNo         = PayNo;
            model.Type_id_PointStatus = 171;
            model.Point         = point;
            model.Remark        = remark;
            model.Time_Update   = DateTime.Now;
            model.User_id       = user.id;
            model.User_RealName = user.RealName;
            model.User_UserName = user.UserName;
            if (addflag)
            {
                B_Lebi_User_Point.Add(model);
            }
            else
            {
                B_Lebi_User_Point.Update(model);
            }
            UpdateUserPoint(user);
        }
예제 #22
0
 public static void Add(string content, string tablename, string keyid, Lebi_Administrator admin, string description)
 {
     Add(content, tablename, keyid, null, admin, null, description);
 }
예제 #23
0
        /// <summary>
        /// 站点语言
        /// </summary>
        /// <param name="InputName"></param>
        /// <param name="Code"></param>
        /// <returns></returns>
        public static string SiteLanguageCheckbox(string InputName, string Code, string languagecode, Lebi_Administrator admin = null)
        {
            string where = "";
            if (admin != null)
            {
                if (admin.Site_ids != "" && Site.Instance.SiteCount > 1)
                {
                    where = "id in (" + admin.Site_ids + ")";
                }
            }
            List <Lebi_Site> sites = B_Lebi_Site.GetList(where, "Sort desc", Site.Instance.SiteCount, 1);
            string           str   = "";

            Code = "," + Code + ",";
            foreach (Lebi_Site site in sites)
            {
                if (Site.Instance.SiteCount > 1)
                {
                    if (str == "")
                    {
                        str = site.SubName + ":";
                    }
                    else
                    {
                        str += "<br/>" + site.SubName + ":";
                    }
                }
                List <Lebi_Language> models = B_Lebi_Language.GetList("Site_id=" + site.id + "", "");
                foreach (Lebi_Language model in models)
                {
                    string sel = "";
                    if (Code.Contains("," + model.id + ","))
                    {
                        sel = "checked";
                    }
                    str += "<label><input type=\"checkbox\" name=\"" + InputName + "\" id=\"" + InputName + "\" shop=\"true\" value=\"" + model.id + "\" " + sel + ">" + model.Name + "</label>&nbsp;";
                }
            }
            return(str);
        }
예제 #24
0
 /// <summary>
 /// 安全方式绑定表单数据
 /// </summary>
 public static Lebi_Administrator SafeBindForm(Lebi_Administrator model)
 {
     return(D_Lebi_Administrator.Instance.SafeBindForm(model));
 }
예제 #25
0
        /// <summary>
        /// 添加记录
        /// </summary>
        /// <param name="content"></param>
        /// <param name="tablename"></param>
        /// <param name="keyid"></param>
        public static void Add(string content, string tablename, string keyid, Lebi_User user, Lebi_Administrator admin, Lebi_Supplier supplier, string description)
        {
            Lebi_Log log = new Lebi_Log();

            if (admin != null)
            {
                log.Admin_id  = admin.id;
                log.AdminName = admin.UserName;
            }
            if (user != null)
            {
                log.User_id  = user.id;
                log.UserName = user.UserName;
            }
            if (supplier != null)
            {
                log.Supplier_id      = supplier.id;
                log.Supplier_SubName = supplier.SubName;
            }
            if (keyid.Length > 500)
            {
                keyid = keyid.Substring(0, 500);
            }
            log.Content   = content;
            log.Keyid     = keyid;
            log.TableName = tablename;
            if (RequestTool.GetRequestUrlNonDomain().Length > 400)
            {
                log.URL = RequestTool.GetRequestUrlNonDomain().Substring(0, 400);
            }
            else
            {
                log.URL = RequestTool.GetRequestUrlNonDomain();
            }
            if (RequestTool.GetUrlReferrerNonDomain().Length > 400)
            {
                log.RefererURL = RequestTool.GetUrlReferrerNonDomain().Substring(0, 400);
            }
            else
            {
                log.RefererURL = RequestTool.GetUrlReferrerNonDomain();
            }
            if (description.Length > 500)
            {
                log.Description = description.Substring(0, 500);
            }
            else
            {
                log.Description = description;
            }
            log.IP_Add = RequestTool.GetClientIP();
            B_Lebi_Log.Add(log);
        }
예제 #26
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static int Add(Lebi_Administrator model)
 {
     return(D_Lebi_Administrator.Instance.Add(model));
 }
예제 #27
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static void Update(Lebi_Administrator model)
 {
     D_Lebi_Administrator.Instance.Update(model);
 }
예제 #28
0
 public static void Add(string content, Lebi_Administrator admin)
 {
     Add(content, null, admin, null);
 }
예제 #29
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="user"></param>
 /// <param name="money"></param>
 /// <param name="type"></param>
 /// <param name="admin"></param>
 /// <param name="description"></param>
 /// <param name="remark"></param>
 /// <param name="fanxian">是否包含返现款消费</param>
 public static void AddMoney(Lebi_User user, decimal money, int type, Lebi_Administrator admin, string description, string remark, bool fanxian = true)
 {
     AddMoney(user, money, type, null, admin, description, remark, fanxian);
 }
예제 #30
0
파일: Language.cs 프로젝트: zwkjgs/LebiShop
        /// <summary>
        /// 站点语言
        /// </summary>
        /// <param name="InputName"></param>
        /// <param name="Code"></param>
        /// <returns></returns>
        public static string SiteLanguageCheckbox(string InputName, string Code, string languagecode, Lebi_Administrator admin = null)
        {
            string where = "";
            if (admin != null)
            {
                if (admin.Site_ids != "" && Site.Instance.SiteCount > 1)
                {
                    where = "id in (" + admin.Site_ids + ")";
                }
            }
            List <Lebi_Site> sites = B_Lebi_Site.GetList(where, "Sort desc", Site.Instance.SiteCount, 1);
            string           str   = "";

            Code = "," + Code + ",";
            foreach (Lebi_Site site in sites)
            {
                if (Site.Instance.SiteCount > 1)
                {
                    if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                    {
                        str += "<div class=\"col-sm-12\"><div class=\"row\"><div class=\"input-group\"><label for=\"\">" + site.SubName + ":</label>";
                    }
                    else
                    {
                        if (str == "")
                        {
                            str = site.SubName + ":";
                        }
                        else
                        {
                            str += "<br/>" + site.SubName + ":";
                        }
                    }
                }
                List <Lebi_Language> models = B_Lebi_Language.GetList("Site_id=" + site.id + "", "");
                foreach (Lebi_Language model in models)
                {
                    string sel = "";
                    if (Code.Contains("," + model.id + ","))
                    {
                        sel = "checked";
                    }
                    if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                    {
                        str += "<label class=\"custom-control custom-checkbox m-r-20\"><input type=\"checkbox\" id=\"" + InputName + "" + model.id + "\" name=\"" + InputName + "\" value=\"" + model.id + "\" class=\"custom-control-input\" shop=\"true\" " + sel + "><span class=\"custom-control-label\">" + model.Name + "</span></label>";
                    }
                    else
                    {
                        str += "<input type=\"checkbox\" name=\"" + InputName + "\" id=\"" + InputName + "" + model.id + "\" shop=\"true\" value=\"" + model.id + "\" " + sel + "><label for=\"" + InputName + "" + model.id + "\">" + model.Name + "</label>";
                    }
                }
                if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                {
                    str += "</div></div></div>";
                }
            }
            return(str);
        }