コード例 #1
0
ファイル: mail.ashx.cs プロジェクト: jsonchou/jsonsite
        public void ProcessRequest(HttpContext context)
        {
            JC.Model.sites msite  = new Model.sites();
            JC.Model.posts mpost  = new Model.posts();
            JC.BLL.sites   bsites = new BLL.sites();
            JC.BLL.posts   bposts = new BLL.posts();

            var tbs = "msgs";

            key = obj["siteKey"].ToString();

            context.Response.ContentType = "text/plain";
            var name   = context.Request.Form["name"];
            var mobile = context.Request.Form["mobile"];
            var info   = context.Request.Form["info"];
            var ua     = context.Request.Form["ua"];
            var date   = DateTime.Now.ToString();
            var res    = "";

            msite = bsites.GetList()[0];

            try
            {
                var mailFrom   = msite.mail;
                var mailPwd    = JC.Common.DESEncrypt.Decrypt(msite.mailpwd, key);//破解密码
                var smtpServer = msite.mailsmtp;
                var smtpPort   = msite.mailport;
                var mailToList = new List <string>();
                var tit        = "客户" + name + ",手机" + mobile + ",发过来的咨询邮件--" + msite.title;
                var bod        = @"<p>用户名称:<b>" + name + "</b></p>";
                bod += "<p>用户手机:<b>" + mobile + ":</b></p>";
                bod += "<p>UA:<b>" + ua + ":</b></p>";
                bod += @"<hr />";
                bod += @"<p>咨询内容:<b>" + info + "</b></p>";
                bod += @"<p style='text-align:right'>" + date + "</p>";

                JC.Common.Common.MultiSendEmail(smtpServer, smtpPort, mailFrom, mailPwd, mailToList, null, null, tit, bod, null, true);

                //插入数据库
                mpost.postby     = name;
                mpost.postdate   = DateTime.Now;
                mpost.modifydate = DateTime.Now;
                mpost.content    = info;
                mpost.ext1       = mobile;
                mpost.enable     = 0;
                mpost.read       = 0;
                mpost.ext        = tbs;//VIP code

                bposts.Add(mpost);

                res = "{status:\"1\",msg:\"邮件发送成功!\"}";
            }
            catch (Exception)
            {
                res = "{status:\"0\",msg:\"邮件发送失败!\"}";
                throw;
            }
            context.Response.Write(res);
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var id = Request.QueryString["id"];

            if (!string.IsNullOrEmpty(id))
            {
                post = bposts.Get(int.Parse(id));
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var id = Request.QueryString["id"];

            if (!string.IsNullOrEmpty(id))
            {
                post = bposts.Get(int.Parse(id));
            }
            var obj = Common.JsonHelper.GetJsonSiteObject();

            pos = (List <string>)obj["site"]["friendlinkposition"].ToObject(typeof(List <string>));
        }
コード例 #4
0
ファイル: edit.aspx.cs プロジェクト: jsonchou/jsonsite
        protected void Page_Load(object sender, EventArgs e)
        {
            var id = Request.QueryString["id"];

            menus = bmenus.GetListByPage("", "path asc", 0, 100);

            if (!string.IsNullOrEmpty(id))
            {
                post = bposts.Get(int.Parse(id));
            }

            //VIP Code
            var obj = Common.JsonHelper.GetJsonSiteObject();

            tags = (List <string>)obj["posts"][mymodule]["tag"].ToObject(typeof(List <string>));

            //无论如何,禁止更多下拉菜单选项
            menu       = menus.FindAll(c => c.linktag == mymodule)[0];
            myparentid = menu.parentid.ToString();
            mypath     = menu.path;
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var id = Request.QueryString["id"];

            menus = bmenus.GetListByPage("", "path asc", 0, 100);

            if (!string.IsNullOrEmpty(id))
            {
                post = bposts.Get(int.Parse(id));

                menu = menus.Find(c => c.id == post.typeid);
                if (menu != null)
                {
                    myparentid = menu.parentid.ToString();
                    mypath     = menu.path;
                }

                ////无论如何,禁止更多下拉菜单选项
                //menu = menus.FindAll(c => c.linktag == mymodule)[0];
                //myparentid = menu.parentid.ToString();
                //mypath = menu.path;
            }
        }
コード例 #6
0
ファイル: update.ashx.cs プロジェクト: jsonchou/jsonsite
        public void ProcessRequest(HttpContext context)
        {
            var str  = "";
            var user = (Model.users)HttpContext.Current.Session[userKey];

            BLL.logs blogs = new BLL.logs();
            if (user != null)
            {
                context.Response.ContentType = "text/plain";
                var id     = context.Request.Form["id"];//ids:2,4,6
                var tb     = context.Request.Form["model"];
                var flag   = context.Request.Form["flag"];
                var flagcn = context.Request.Form["flagcn"];
                var v      = Int32.Parse(context.Request.Form["v"]);

                if (!string.IsNullOrEmpty(id))
                {
                    if (tb == "users")
                    {
                        BLL.users   bl  = new BLL.users();
                        Model.users mod = bl.Get(Int32.Parse(id));
                        if (flag == "isadmin")
                        {
                            mod.isadmin    = v;
                            mod.modifydate = DateTime.Now;
                            bl.Update(mod);
                        }
                    }
                    else if (tb == "posts")
                    {
                        BLL.posts   bl  = new BLL.posts();
                        Model.posts mod = bl.Get(Int32.Parse(id));
                        switch (flag)
                        {
                        case "top":
                            mod.top = v;
                            break;

                        case "hot":
                            mod.hot = v;
                            break;

                        case "intro":
                            mod.intro = v;
                            break;

                        case "read":
                            mod.read = v;
                            break;

                        case "blank":
                            mod.blank = v;
                            break;

                        case "enable":
                            mod.enable = v;
                            break;
                        }
                        mod.modifydate = DateTime.Now;
                        bl.Update(mod);
                    }
                    else if (tb == "modules")
                    {
                        BLL.modules   bl  = new BLL.modules();
                        Model.modules mod = bl.Get(Int32.Parse(id));
                        switch (flag)
                        {
                        case "blank":
                            mod.blank = v;
                            break;
                        }
                        bl.Update(mod);
                    }

                    //保存日志
                    Model.logs lg = new Model.logs();
                    lg.loginfo = "表:" + tb + ",ID:" + id + "设置" + flagcn;
                    App_Code.PageBase.UserLog("修改", lg);

                    str = "{\"code\":1,\"msg\":\"" + id + "修改成功\"}";
                }
                else
                {
                    str = "{\"code\":0,\"msg\":\"ID传值错误\"}";
                }
            }
            else
            {
                str = "{\"code\":-1,\"msg\":\"权限错误\"}";
            }
            context.Response.Write(str);
        }
コード例 #7
0
ファイル: PostsController.cs プロジェクト: jsonchou/jsonsite
 // GET api/values/5
 public string Get(int id)
 {
     model = bll.Get(id);
     return(JsonConvert.SerializeObject(model));
 }
コード例 #8
0
ファイル: ad.ascx.cs プロジェクト: jsonchou/jsonsite
 protected void Page_Load(object sender, EventArgs e)
 {
     mpost = bpost.GetList("ext='widgets' and enable=1 and ext1 = '文章详情页' ")[0];
 }