Example #1
0
        void GetAccount()
        {
            if (Session["strOpenID"] != null && Session["strOpenID"].ToString() != "")
            {
                strOpenID = Session["strOpenID"].ToString();
            }
            else
            {
                return;
            }
            if (null == Request.QueryString["ID"])
            {
                strSiteID = "8C45500B9A6D4FBD8A4DE49AC19FE74E";
            }
            else
            {
                strSiteID = Common.Common.NoHtml(Request.QueryString["ID"].ToString());
            }
            Session["siteid"] = strSiteID;
            DAL.SYS.AccountDAL dalAccount = new DAL.SYS.AccountDAL();;
            DataSet            ds         = dalAccount.GetAccountExtData(strSiteID);

            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                strTheme               = ds.Tables[0].Rows[0]["Themes"].ToString();
                strTitle               = ds.Tables[0].Rows[0]["Name"].ToString();
                strSiteCode            = ds.Tables[0].Rows[0]["SiteCode"].ToString();
                Session["strSiteCode"] = strSiteCode;
            }
        }
Example #2
0
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (this.txtNewPD.Text.Equals("") || this.txtSecPD.Text.Equals(""))
            {
                Common.MessageBox.Show(this, "输入的新密码不能为空,请重新输入!");
                return;
            }

            if (this.txtOldPD.Text == this.txtNewPD.Text)
            {
                Common.MessageBox.Show(this, "新密码与旧密码不能一样,请重新输入!");
                return;
            }

            if (this.txtNewPD.Text != this.txtSecPD.Text)
            {
                Common.MessageBox.Show(this, "两次输入的新密码不一致,请重新输入!");
                return;
            }

            //取旧口令
            DAL.SYS.AccountDAL dal = new DAL.SYS.AccountDAL();
            if (null == Session["strAccountID"])
            {
                Session.Abandon();
                Response.Write("<script language=JavaScript>location.href='Login.aspx';</script>");
                Response.End();
            }
            DataSet ds = dal.GetAccountByID(Session["strAccountID"].ToString());

            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                if (Common.Common.MD5(this.txtOldPD.Text) != ds.Tables[0].Rows[0]["Password"].ToString())
                {
                    Common.MessageBox.Show(this, "原密码不对,请重新输入!");
                    return;
                }

                if (dal.UpdateAccountPD(Session["strAccountID"].ToString(), Common.Common.MD5(this.txtSecPD.Text)))
                {
                    Response.Write("<script language='javascript'>alert('修改完成,请重新登录!');</script>");
                    Session.Abandon();
                    Response.Write("<script language=JavaScript>parent.location.href='Login.aspx';</script>");
                    Response.End();
                }
                else
                {
                    Common.MessageBox.Show(this, "修改失败,请重新登录!");
                    return;
                }
            }
            else
            {
                Session.Abandon();
                Response.Write("<script language=JavaScript>parent.location.href='Login.aspx';</script>");
                Response.End();
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSiteID      = string.Empty;
            string strSiteCode    = string.Empty;
            string strTitle       = string.Empty;
            string strTheme       = string.Empty;
            string strAlbumTypeID = string.Empty;

            if (null == Request.QueryString["album"])
            {
                return;
            }
            strAlbumTypeID = Common.Common.NoHtml(Request.QueryString["album"].ToString());

            //取站点信息
            DAL.SYS.AccountDAL     dalAccount   = new DAL.SYS.AccountDAL();
            DAL.Album.PhotoWallDAL dalPhotoWall = new DAL.Album.PhotoWallDAL();

            DataSet dsAccount = dalPhotoWall.GetAccountData(strAlbumTypeID);

            if (null != dsAccount && dsAccount.Tables.Count > 0 && dsAccount.Tables[0].Rows.Count > 0)
            {
                strTheme               = dsAccount.Tables[0].Rows[0]["Themes"].ToString();
                strTitle               = dsAccount.Tables[0].Rows[0]["Name"].ToString();
                strSiteCode            = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
                strSiteID              = dsAccount.Tables[0].Rows[0]["ID"].ToString();
                Session["strSiteCode"] = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
            }

            //取站点相册列表
            DataSet dsThumbList = dalPhotoWall.GetPhotoWall(strAlbumTypeID);
            List <Model.Album.PhotoWall> lstThumb = new List <Model.Album.PhotoWall>();

            foreach (DataRow row in dsThumbList.Tables[0].Rows)
            {
                Model.Album.PhotoWall model = DataConvert.DataRowToModel <Model.Album.PhotoWall>(row);
                lstThumb.Add(model);
            }


            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/PhotoWall/ThumbList.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["sitecode"] = strSiteCode;
            context.TempData["title"]    = "照片列表";
            context.TempData["lstThumb"] = lstThumb;
            context.TempData["footer"]   = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Example #4
0
        protected override bool BeforeLoad()
        {
            AlbumTypeID = Common.Common.NoHtml(Request.QueryString["ID"].ToString());

            //取站点信息
            DAL.SYS.AccountDAL dalAccount = new DAL.SYS.AccountDAL();
            DAL.Album.AlbumDAL dalAlbum   = new DAL.Album.AlbumDAL();

            DataSet dsAccount = dalAlbum.GetAccountData(AlbumTypeID);

            if (null != dsAccount && dsAccount.Tables.Count > 0 && dsAccount.Tables[0].Rows.Count > 0)
            {
                SiteCode = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
                SiteID   = dsAccount.Tables[0].Rows[0]["ID"].ToString();
            }
            return(base.BeforeLoad());
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSiteID      = string.Empty;
            string strSiteCode    = string.Empty;
            string strTitle       = string.Empty;
            string strTheme       = string.Empty;
            string strAlbumTypeID = string.Empty;

            if (null == Request.QueryString["album"])
            {
                return;
            }
            strAlbumTypeID = Common.Common.NoHtml(Request.QueryString["album"].ToString());

            //取站点信息
            DAL.SYS.AccountDAL     dalAccount   = new DAL.SYS.AccountDAL();
            DAL.Album.UserPhotoDAL dalUserPhoto = new DAL.Album.UserPhotoDAL();

            DataSet dsAccount = dalUserPhoto.GetAccountData(strAlbumTypeID);

            if (null != dsAccount && dsAccount.Tables.Count > 0 && dsAccount.Tables[0].Rows.Count > 0)
            {
                strTheme               = dsAccount.Tables[0].Rows[0]["Themes"].ToString();
                strTitle               = dsAccount.Tables[0].Rows[0]["Name"].ToString();
                strSiteCode            = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
                strSiteID              = dsAccount.Tables[0].Rows[0]["ID"].ToString();
                Session["strSiteCode"] = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
            }

            //取站点相册列表
            DataSet      dsThumbList = dalUserPhoto.GetUserPhoto(strAlbumTypeID);
            List <Thumb> lstThumb    = new List <Thumb>();

            foreach (DataRow row in dsThumbList.Tables[0].Rows)
            {
                Thumb p = new Thumb();
                p.src  = "/USER_PHOTO/" + row["FilePath"].ToString();
                p.alt  = "/USER_PHOTO/" + row["FilePath"].ToString();
                p.desc = row["ID"].ToString();
                //p.desc = row["ID"].ToString();
                lstThumb.Add(p);
            }
            string strReturn = ListToJson(lstThumb);

            Response.Write(strReturn);
        }
Example #6
0
        protected override void AddTempData(JinianNet.JNTemplate.TemplateContext context)
        {
            //取站点信息
            DAL.SYS.AccountDAL dalAccount = new DAL.SYS.AccountDAL();
            DAL.Album.AlbumDAL dalAlbum   = new DAL.Album.AlbumDAL();

            //取站点相册列表
            DataSet             dsAlbumType = dalAlbum.GetAlbumTypeList(SiteCode);
            List <PA_AlbumType> liAlbumType = new List <PA_AlbumType>();

            if (null != dsAlbumType && dsAlbumType.Tables.Count > 0 && dsAlbumType.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in dsAlbumType.Tables[0].Rows)
                {
                    PA_AlbumType model = DataConvert.DataRowToModel <PA_AlbumType>(row);
                    liAlbumType.Add(model);
                }
            }

            context.TempData["AlbumTypelist"] = liAlbumType;
        }
Example #7
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string strUserName = this.txtName.Value.Trim();
            string strPassWrod = this.txtPD.Value.Trim();

            if (strUserName.Equals("") || strPassWrod.Equals(""))
            {
                MessageBox.Show(this, "登录名与口令不能这空!");
                return;
            }

            //if (string.Compare(Session["CheckCode"].ToString(), this.txtRand.Text, true) != 0)
            //{
            //    MessageBox.Show(this, "验证码错误,请输入正确的验证码。");
            //    return;
            //}

            DAL.SYS.AccountDAL dal = new DAL.SYS.AccountDAL();

            DataSet dsAccount = dal.GetAccountData(strUserName, Common.Common.MD5(strPassWrod));

            if (dsAccount.Tables[0].Rows.Count < 1 || string.IsNullOrEmpty(dsAccount.Tables[0].Rows[0]["ID"].ToString()))
            {
                MessageBox.Show(this, "用户名或口令不正确,请核对后重新登录!");
                return;
            }
            //if (!isinip(Page.Request.UserHostAddress, "192.168.1.0", "192.168.1.255"))
            //{

            //}
            Session["strAccountID"] = dsAccount.Tables[0].Rows[0]["ID"].ToString();
            Session["strLoginName"] = dsAccount.Tables[0].Rows[0]["LoginName"].ToString();
            Session["strSiteName"]  = dsAccount.Tables[0].Rows[0]["Name"].ToString();
            Session["strRoleCode"]  = dsAccount.Tables[0].Rows[0]["RoleID"].ToString();
            Session["strIP"]        = Page.Request.UserHostAddress.ToString();
            Session["strSiteCode"]  = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
            Session["SiteCategory"] = dsAccount.Tables[0].Rows[0]["SiteCategory"].ToString();

            Response.Redirect("Index.aspx", false);
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strMobile   = string.Empty;
            string strPassWord = string.Empty;
            string strSiteCode = string.Empty;
            string strTitle    = string.Empty;
            string strTheme    = string.Empty;

            if (null == Session["strSiteCode"])
            {
                return;
            }
            strSiteCode = Session["strSiteCode"].ToString();
            if (null != Request.QueryString["action"])
            {
                if (Request.QueryString["action"] == "login")
                {
                    strMobile   = Common.Common.NoHtml(Request.Form["mobile"].ToString());
                    strPassWord = Common.Common.NoHtml(Request.Form["password"].ToString());

                    DAL.SYS.CustomerDAL dal = new DAL.SYS.CustomerDAL();
                    DataSet             ds  = dal.GetCustomerData(strMobile, Common.Common.MD5(strPassWord), strSiteCode);

                    if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        CustomerSession.strCustomerID = ds.Tables[0].Rows[0]["ID"].ToString();
                        CustomerSession.strMobile     = ds.Tables[0].Rows[0]["Mobile"].ToString();
                        CustomerSession.strSiteCode   = ds.Tables[0].Rows[0]["SiteCode"].ToString();
                        CustomerSession.strOpenID     = ds.Tables[0].Rows[0]["OpenID"].ToString();
                        CustomerSession.strName       = ds.Tables[0].Rows[0]["Name"].ToString();
                        Session["strName"]            = CustomerSession.strName;
                        Session["strCustomerID"]      = CustomerSession.strCustomerID;
                        Session["strSiteCode"]        = CustomerSession.strSiteCode;
                        Session["strOpenID"]          = CustomerSession.strOpenID;
                    }
                    //Response.Redirect("ProductList.aspx?SiteCode=" + strSiteCode, false);
                    Response.Redirect("LoginOK.aspx", false);
                }
            }

            DAL.SYS.AccountDAL dalAccount   = new DAL.SYS.AccountDAL();
            DataSet            dsAccountExt = dalAccount.GetAExtDataBySiteCode(strSiteCode);

            if (null != dsAccountExt && dsAccountExt.Tables.Count > 0 && dsAccountExt.Tables[0].Rows.Count > 0)
            {
                strTheme = dsAccountExt.Tables[0].Rows[0]["Themes"].ToString();
                strTitle = dsAccountExt.Tables[0].Rows[0]["Name"].ToString();
            }

            string text = string.Empty;

            if (!File.Exists(Server.MapPath("Themes/" + strTheme + "/Login.html")))
            {
                text = System.IO.File.ReadAllText(Server.MapPath("Themes/Default/Login.html"));
            }
            else
            {
                text = System.IO.File.ReadAllText(Server.MapPath("Themes/" + strTheme + "/Login.html"));
            }
            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"] = "用户登录";
            if (null == Session["strName"])
            {
                context.TempData["username"] = "******";
            }
            else
            {
                context.TempData["username"] = CustomerSession.strName;
            }
            if (null == Session["customerid"])
            {
                context.TempData["customerid"] = null;
            }
            else
            {
                context.TempData["customerid"] = CustomerSession.strCustomerID;
            }
            context.TempData["sitename"] = strTitle;
            context.TempData["sitecode"] = strSiteCode;
            context.TempData["footer"]   = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Example #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strMobile    = string.Empty;
            string strUserName  = string.Empty;
            string strPassWord  = string.Empty;
            string strPassWord1 = string.Empty;
            string strSiteCode  = string.Empty;
            string strSiteName  = string.Empty;
            string strErrInfo   = string.Empty;

            if (null != Request.QueryString["SiteCode"])
            {
                strSiteCode = Common.Common.NoHtml(Request.QueryString["SiteCode"].ToString());
                CustomerSession.strSiteCode = strSiteCode;
            }
            //strSiteID = "KM_HLF";
            DAL.SYS.AccountDAL dalAccount = new DAL.SYS.AccountDAL();
            DataSet            dsAccount  = dalAccount.GetSiteData(strSiteCode);

            if (null != dsAccount && dsAccount.Tables.Count > 0 && dsAccount.Tables[0].Rows.Count > 0)
            {
                strSiteCode = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
                strSiteName = dsAccount.Tables[0].Rows[0]["Name"].ToString();
                GlobalSession.strSiteCode = strSiteCode;
            }

            if (null != Request.QueryString["action"])
            {
                if (Common.Common.NoHtml(Request.QueryString["action"].ToString()) == "save")
                {
                    strMobile    = Request.Form["mobile"].ToString();
                    strUserName  = Request.Form["username"].ToString();
                    strPassWord  = Request.Form["password"].ToString();
                    strPassWord1 = Request.Form["password1"].ToString();

                    if (string.IsNullOrEmpty(strMobile) || string.IsNullOrEmpty(strUserName) || string.IsNullOrEmpty(strPassWord) || string.IsNullOrEmpty(strPassWord1))
                    {
                        strErrInfo = "请完整填写注册信息!";
                    }
                    if (strPassWord != strPassWord1)
                    {
                        strErrInfo = "两次输入的密码不一致!";
                    }

                    DAL.SYS.CustomerDAL dalCustomer = new DAL.SYS.CustomerDAL();

                    if (dalCustomer.CheckMobile(strMobile))
                    {
                        strErrInfo = "此手机号码已经注册!";
                    }
                    else
                    {
                        Model.SYS.SYS_Customer modelAdd = new Model.SYS.SYS_Customer
                        {
                            ID       = Guid.NewGuid().ToString("N").ToUpper(),
                            Mobile   = strMobile,
                            Name     = strUserName,
                            PassWord = Common.Common.MD5(strPassWord),
                            OpenID   = "",
                            SiteCode = GlobalSession.strSiteCode
                        };
                        if (dalCustomer.AddCustomerData(modelAdd))
                        {
                            strErrInfo = "账户添加成功!";
                            Response.Redirect("ProductList.aspx?SiteCode=" + strSiteCode, false);
                        }
                        else
                        {
                            strErrInfo = "账户添加失败!";
                        }
                    }
                }
            }
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/Default/Reg.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["SiteCode"] = GlobalSession.strSiteCode;
            context.TempData["ErrInfo"]  = strErrInfo;
            context.TempData["Title"]    = "用户注册";
            context.TempData["SiteName"] = strSiteName;
            context.TempData["footer"]   = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSiteID      = string.Empty;
            string strSiteCode    = string.Empty;
            string strTitle       = string.Empty;
            string strTheme       = string.Empty;
            string strAlbumTypeID = string.Empty;
            string strOpenID      = string.Empty;

            //if (null == Request.QueryString["ID"])
            //{
            //    return;
            //}
            //if (null == Request.QueryString["OpenID"])
            //{
            //    return;
            //}
            //strSiteCode = Common.Common.NoHtml(Request.QueryString["ID"].ToString());
            //if (Request.QueryString["openid"].ToString().Length > 29 || Request.QueryString["openid"].ToString().Length < 25)
            //{
            //    strOpenID = Common.Common.NoHtml(Request.QueryString["openid"].ToString());
            //}
            //else
            //{
            //    strOpenID = Request.QueryString["openid"].ToString();
            //}



            if (null == Request["state"] || Request["state"] == "")
            {
                return;
            }
            else
            {
                strSiteCode            = Common.Common.NoHtml(Request.QueryString["state"].ToString());
                Session["strSiteCode"] = strSiteCode;
            }

            string code = Request.QueryString["code"] as string;

            if (!string.IsNullOrEmpty(code))
            {
                WXConfigDAL           dal      = new WXConfigDAL();
                Model.WeiXin.WXConfig wxConfig = dal.GetWXConfigBySiteCode(strSiteCode);
                if (wxConfig != null)
                {
                    WeiXinCore.Models.WeiXinConfig weixinConfig = new WeiXinCore.Models.WeiXinConfig()
                    {
                        ID        = wxConfig.WXID,
                        Name      = wxConfig.WXName,
                        Token     = wxConfig.WXToken,
                        AppId     = wxConfig.WXAppID,
                        AppSecret = wxConfig.WXAppSecret
                    };
                    WeiXinCore.WeiXin weixin            = new WeiXinCore.WeiXin(weixinConfig);
                    Oauth2AccessToken oauth2AccessToken = weixin.GetOauth2AccessToken(code);
                    if (oauth2AccessToken != null)
                    {
                        strOpenID = oauth2AccessToken.OpenID;
                    }
                }
            }



            Session["OpenID"] = strOpenID;
            //取站点信息
            DAL.SYS.AccountDAL  dalAccount   = new DAL.SYS.AccountDAL();
            DAL.Album.PhotoList dalPhotoList = new DAL.Album.PhotoList();

            DataSet dsAccount = dalAccount.GetAExtDataBySiteCode(strSiteCode);

            if (null != dsAccount && dsAccount.Tables.Count > 0 && dsAccount.Tables[0].Rows.Count > 0)
            {
                strTheme               = dsAccount.Tables[0].Rows[0]["Themes"].ToString();
                strTitle               = dsAccount.Tables[0].Rows[0]["Name"].ToString();
                strSiteCode            = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
                strSiteID              = dsAccount.Tables[0].Rows[0]["ID"].ToString();
                Session["strSiteCode"] = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
            }

            //取站点相册列表
            DataSet dsPhotoList = dalPhotoList.GetPhotoList(strSiteCode);
            List <Model.Album.PhotoList> liPhotoList = new List <Model.Album.PhotoList>();

            if (null != dsPhotoList && dsPhotoList.Tables.Count > 0 && dsPhotoList.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in dsPhotoList.Tables[0].Rows)
                {
                    Model.Album.PhotoList model = DataConvert.DataRowToModel <Model.Album.PhotoList>(row);
                    liPhotoList.Add(model);
                }
            }

            //读取模板内容
            string text = string.Empty;

            if (!File.Exists(Server.MapPath("Themes/" + strTheme + "/PhotoWall.html")))
            {
                text = System.IO.File.ReadAllText(Server.MapPath("Themes/PhotoWall/PhotoWall.html"));
            }
            else
            {
                text = System.IO.File.ReadAllText(Server.MapPath("Themes/" + strTheme + "/PhotoWall.html"));
            }


            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"]         = strTitle;
            context.TempData["siteid"]        = strSiteID;
            context.TempData["footer"]        = "奥琦微商易";
            context.TempData["sitecode"]      = strSiteCode;
            context.TempData["AlbumTypelist"] = liPhotoList;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Example #11
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (!BeforeLoad())
            {
                return;
            }
            string strTitle        = string.Empty;
            string siteSettingJson = File.ReadAllText(Server.MapPath("/MicroSite/SiteSetting.json"), System.Text.Encoding.UTF8);

            SiteSetting siteSetting = JsonConvert.DeserializeObject <SiteSetting>(siteSettingJson);

            DAL.SYS.AccountDAL dalAccount = new DAL.SYS.AccountDAL();
            DataSet            ds;

            if (!string.IsNullOrEmpty(SiteCode))
            {
                ds = dalAccount.GetAExtDataBySiteCode(SiteCode);
            }
            else
            {
                SiteID = null == Request.QueryString["ID"] ? siteSetting.DefaultSiteId : Mozart.Common.Common.NoHtml(Request.QueryString["ID"].ToString());
                ds     = dalAccount.GetAccountExtData(SiteID);
            }

            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                var dynamicTable = ds.Tables[0].AsDynamicEnumerable();
                var dynamicObj   = dynamicTable.First();
                Theme    = dynamicObj.Themes;
                strTitle = dynamicObj.Name;
                SiteCode = dynamicObj.SiteCode;
                SiteID   = dynamicObj.ID;
            }
            Session["siteid"]      = SiteID;
            Session["strSiteCode"] = SiteCode;
            List <Module> modules = new List <Module>();

            foreach (Category category in siteSetting.Categories)
            {
                modules.AddRange(category.Modules);
            }
            CurrentModule = modules.FirstOrDefault(w => w.Path == Request.Path);
            SetTemplatePath();
            string templateModuleJsonPath = string.Format(CurrentModule.Setting, "/MicroSite/Themes/" + Theme + "/");
            string ModuleJsonPath         = string.Format(CurrentModule.Setting, "/MicroSite/Modules/");

            if (CurrentModule.IsHomePage)
            {
                ModuleJsonPath = string.Format(CurrentModule.Setting, "/MicroSite/");
            }
            string moduleJsonPhysicalPath         = Server.MapPath(ModuleJsonPath);
            string templateModuleJsonPhysicalPath = Server.MapPath(templateModuleJsonPath);

            ModuleFields = new List <ModuleField>();
            if (File.Exists(templateModuleJsonPhysicalPath))
            {
                string moduleFieldJson = File.ReadAllText(templateModuleJsonPhysicalPath, System.Text.Encoding.UTF8);
                ModuleFields = JsonConvert.DeserializeObject <List <ModuleField> >(moduleFieldJson);
            }
            else
            {
                string moduleFieldJson = File.ReadAllText(moduleJsonPhysicalPath, System.Text.Encoding.UTF8);
                ModuleFields = JsonConvert.DeserializeObject <List <ModuleField> >(moduleFieldJson);
            }

            string text = System.IO.File.ReadAllText(Server.MapPath(TemplatePath));


            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
            foreach (Module module in modules)
            {
                context.TempData[module.Code] = module.Path + "?ID=" + SiteID;
            }

            foreach (ModuleField moduleField in ModuleFields)
            {
                if (moduleField.CanModified)
                {
                    context.TempData[moduleField.Code] = moduleField.Value;
                }
            }
            context.TempData["siteid"]        = SiteID;
            context.TempData["sitecode"]      = SiteCode;
            context.TempData["SiteUrl"]       = "/MicroSite/";
            context.TempData["SiteModuleUrl"] = "/MicroSite/Modules/";
            AddTempData(context);
            JinianNet.JNTemplate.Template template = new JinianNet.JNTemplate.Template(context, text);
            template.Render(Response.Output);
        }
Example #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSiteID      = string.Empty;
            string strSiteCode    = string.Empty;
            string strTitle       = string.Empty;
            string strTheme       = string.Empty;
            string strAlbumTypeID = string.Empty;

            if (null == Request.QueryString["ID"])
            {
                return;
            }
            strAlbumTypeID = Common.Common.NoHtml(Request.QueryString["ID"].ToString());

            //取站点信息
            DAL.SYS.AccountDAL     dalAccount   = new DAL.SYS.AccountDAL();
            DAL.Album.UserPhotoDAL dalUserPhoto = new DAL.Album.UserPhotoDAL();

            DataSet dsAccount = dalUserPhoto.GetAccountData(strAlbumTypeID);

            if (null != dsAccount && dsAccount.Tables.Count > 0 && dsAccount.Tables[0].Rows.Count > 0)
            {
                strTheme               = dsAccount.Tables[0].Rows[0]["Themes"].ToString();
                strTitle               = dsAccount.Tables[0].Rows[0]["Name"].ToString();
                strSiteCode            = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
                strSiteID              = dsAccount.Tables[0].Rows[0]["ID"].ToString();
                Session["strSiteCode"] = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
            }

            //取站点相册列表
            DataSet dsAlbumList = dalUserPhoto.GetUserPhoto(strAlbumTypeID);
            List <Model.Album.UserPhoto> liAlbumList = new List <Model.Album.UserPhoto>();

            if (null != dsAlbumList && dsAlbumList.Tables.Count > 0 && dsAlbumList.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in dsAlbumList.Tables[0].Rows)
                {
                    Model.Album.UserPhoto model = DataConvert.DataRowToModel <Model.Album.UserPhoto>(row);
                    liAlbumList.Add(model);
                }
            }

            //读取模板内容
            string text = string.Empty;

            if (!File.Exists(Server.MapPath("Themes/" + strTheme + "/UserPhoto.html")))
            {
                text = System.IO.File.ReadAllText(Server.MapPath("Themes/PhotoList/UserPhoto.html"));
            }
            else
            {
                text = System.IO.File.ReadAllText(Server.MapPath("Themes/" + strTheme + "/UserPhoto.html"));
            }

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"]     = strTitle;
            context.TempData["siteid"]    = strSiteID;
            context.TempData["footer"]    = "奥琦微商易";
            context.TempData["sitecode"]  = strSiteCode;
            context.TempData["albumlist"] = liAlbumList;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Example #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSiteID   = string.Empty;
            string strTitle    = string.Empty;
            string strTheme    = string.Empty;
            string strSiteCode = string.Empty;

            if (null == Request.QueryString["ID"])
            {
                return;
            }
            strSiteID         = Common.Common.NoHtml(Request.QueryString["ID"].ToString());
            Session["siteid"] = strSiteID;

            DAL.SYS.AccountDAL dalAccount = new DAL.SYS.AccountDAL();
            DataSet            ds         = dalAccount.GetAccountExtData(strSiteID);

            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                strTheme               = ds.Tables[0].Rows[0]["Themes"].ToString();
                strTitle               = ds.Tables[0].Rows[0]["Name"].ToString();
                strSiteCode            = ds.Tables[0].Rows[0]["SiteCode"].ToString();
                Session["strSiteCode"] = strSiteCode;
            }

            string strName    = string.Empty;
            string strMobile  = string.Empty;
            string strContext = string.Empty;

            if (null != Request.QueryString["action"])
            {
                if (Request.QueryString["action"].ToString() == "save")
                {
                    strName    = Common.Common.NoHtml(Request.Form["realname"].ToString());
                    strMobile  = Common.Common.NoHtml(Request.Form["mobile"].ToString());
                    strContext = Common.Common.NoHtml(Request.Form["message"].ToString());
                    if (strContext.Trim() != null && strContext.Trim() != "")
                    {
                        DAL.BBS.BBSGuestBookDAL gbDAL = new DAL.BBS.BBSGuestBookDAL();
                        if (!gbDAL.ExistMsg(strContext))
                        {
                            Model.BBS.BBS_GuestBook gbModel = new Model.BBS.BBS_GuestBook()
                            {
                                ID         = Guid.NewGuid().ToString("N"),
                                UserName   = strName,
                                UserMobile = strMobile,
                                Content    = strContext,
                                Replay     = "",
                                State      = 0,
                                CreateTime = DateTime.Now,
                                SiteCode   = strSiteCode
                            };
                            if (gbDAL.AddGuestBook(gbModel))
                            {
                                Response.Write("<script>alert('操作成功');</script>");
                                #region
                                //#region 消费完成发生消息
                                //string strAppID = string.Empty;
                                //string strSecret = string.Empty;
                                //Model.WeiXin.WXConfig wc = new Model.WeiXin.WXConfig();
                                //WXConfigDAL wcdal = new WXConfigDAL();
                                //wc = wcdal.GetWXConfigBySiteCode(strSiteCode);
                                //if (null != wc)
                                //{
                                //    strAppID = wc.WXAppID;
                                //    strSecret = wc.WXAppSecret;
                                //}
                                //string strToken = WeiXinHelper.GetAccessToken(strAppID, strSecret);

                                //var KeyToken = new { access_token = "" };
                                //var b = JsonConvert.DeserializeAnonymousType(strToken, KeyToken);
                                //string strRToken = b.access_token;

                                //WeiXinHelper.SendCustomTextMessage(strRToken, strOpenID, strMessage);
                                //#endregion
                                //Response.Write("<script>document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {	WeixinJSBridge.call('closeWindow');});</script>");
                                //return;
                                #endregion
                            }
                            else
                            {
                                Response.Write("<script>alert('操作失败,请稍后再试!');</script>");
                            }
                        }
                        else
                        {
                            Response.Write("<script>alert('该信息已提交过');</script>");
                        }
                    }
                }
            }

            //读取模板内容
            string text = string.Empty;
            if (!File.Exists(Server.MapPath("Themes/" + strTheme + "/GuestBook.html")))
            {
                text = System.IO.File.ReadAllText(Server.MapPath("Themes/GuestBook/GuestBook.html"));
            }
            else
            {
                text = System.IO.File.ReadAllText(Server.MapPath("Themes/" + strTheme + "/GuestBook.html"));
            }

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"]    = strTitle;
            context.TempData["siteid"]   = Session["siteid"];
            context.TempData["footer"]   = "奥琦微商易";
            context.TempData["sitecode"] = Session["strSiteCode"].ToString();
            context.TempData["siteid"]   = strSiteID;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Example #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strTitle  = string.Empty;
            string strTheme  = string.Empty;
            string strCustID = string.Empty;

            if (null == Request.QueryString["sitecode"])
            {
                return;
            }
            if (null == Request.QueryString["openid"])
            {
                return;
            }

            string strSiteCode = Common.Common.NoHtml(Request.QueryString["sitecode"].ToString());
            string strOpenID   = string.Empty;

            if (Request.QueryString["openid"].ToString().Length > 29 || Request.QueryString["openid"].ToString().Length < 25)
            {
                strOpenID = Common.Common.NoHtml(Request.QueryString["openid"].ToString());
                return;
            }
            else
            {
                strOpenID = Request.QueryString["openid"].ToString();
            }

            DAL.SYS.AccountDAL dalAccount = new DAL.SYS.AccountDAL();
            DataSet            ds         = dalAccount.GetAExtDataBySiteCode(strSiteCode);

            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                strTheme = ds.Tables[0].Rows[0]["Themes"].ToString();
                strTitle = ds.Tables[0].Rows[0]["Name"].ToString();
                Session["strSiteCode"] = ds.Tables[0].Rows[0]["SiteCode"].ToString();
            }
            //会员卡判断处理
            DAL.SYS.CustomerDAL      dalCust  = new DAL.SYS.CustomerDAL();
            DAL.Site.SiteMemberNoDAL dalMemNo = new DAL.Site.SiteMemberNoDAL();
            string strCustNo = dalCust.GetCustMemberShipNo(strSiteCode, strOpenID);
            string strMemNO  = string.Empty;

            if (strCustNo == "0" || strCustNo == "-1")
            {
                strMemNO = dalMemNo.GetMemberShipNo(strSiteCode);
                if (strCustNo == "-1") //没有用户记录
                {
                    //插入用户记录
                    Model.SYS.SYS_Customer modelAdd = new Model.SYS.SYS_Customer
                    {
                        ID           = Guid.NewGuid().ToString("N").ToUpper(),
                        Mobile       = "",
                        Name         = "",
                        PassWord     = "",
                        OpenID       = strOpenID,
                        SiteCode     = strSiteCode,
                        MemberShipNo = strMemNO
                    };
                    if (!dalCust.AddCustomerData(modelAdd))
                    {
                        return;
                    }
                }
                if (strCustNo == "0") //有用户记录,没有会员账号
                {
                    //写入用户账号
                    strMemNO = dalMemNo.GetMemberShipNo(strSiteCode);
                    dalCust.UpdateCutMemberShipNo(strSiteCode, strOpenID, strMemNO);
                }
                //修改站点账户状态
                dalMemNo.UpdateMemNoState(strSiteCode, strMemNO, "1");
            }
            if (strCustNo == "0" || strCustNo == "-1")
            {
                strCustNo = dalCust.GetCustMemberShipNo(strSiteCode, strOpenID);
            }
            //取最近的消费记录

            //读取模板内容
            string text = string.Empty;

            if (!File.Exists(Server.MapPath("Themes/" + strTheme + "/MemberShip.html")))
            {
                text = System.IO.File.ReadAllText(Server.MapPath("Themes/MemberShip/MemberShip.html"));
            }
            else
            {
                text = System.IO.File.ReadAllText(Server.MapPath("Themes/" + strTheme + "/MemberShip.html"));
            }

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
            Common.QRCode qr = new Common.QRCode();
            //context.TempData["qrcode"] = qr.GetQRCode("http://114.215.108.27/WebService/CustMemNo.aspx?SiteCode=" + strSiteCode + "&MemNo=" + strCustNo + "&OpenId=" + strOpenID);
            context.TempData["qrcode"]   = qr.GetImageQRCode("http://114.215.108.27/WebService/CustMemNo.aspx?SiteCode=" + strSiteCode + "&MemNo=" + strCustNo + "&OpenId=" + strOpenID);
            context.TempData["memno"]    = strCustNo;
            context.TempData["title"]    = strTitle;
            context.TempData["siteid"]   = Session["siteid"];
            context.TempData["footer"]   = "奥琦微商易";
            context.TempData["sitecode"] = Session["strSiteCode"].ToString();

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }