Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strProductID = string.Empty;
            string strSiteCode  = string.Empty;

            if (null == Request.QueryString["id"])
            {
                return;
            }
            strProductID = Common.Common.NoHtml(Request.QueryString["id"].ToString());
            DAL.Album.PhotoWallDAL dal = new DAL.Album.PhotoWallDAL();
            DataSet ds = dal.GetUserThumb(strProductID);

            Model.Album.UserPhoto model = new Model.Album.UserPhoto();
            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                model = DataConvert.DataRowToModel <Model.Album.UserPhoto>(ds.Tables[0].Rows[0]);
            }
            strSiteCode = model.SiteCode;

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

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

            context.TempData["sitecode"] = strSiteCode;
            context.TempData["title"]    = "照片信息";
            context.TempData["pDetail"]  = model;
            context.TempData["footer"]   = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Example #2
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 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (null == Request.QueryString["id"])
            {
                return;
            }
            strThumbID = Common.Common.NoHtml(Request.QueryString["id"].ToString());
            DAL.Album.UserPhotoDAL dal = new DAL.Album.UserPhotoDAL();
            DataSet ds = dal.GetMyThumb(strThumbID);

            Model.Album.UserPhoto model = new Model.Album.UserPhoto();
            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                model = DataConvert.DataRowToModel <Model.Album.UserPhoto>(ds.Tables[0].Rows[0]);
            }
            strSiteCode = model.SiteCode;
            strOpenID   = model.OpenId;
            strFilePath = model.FilePath;

            //插入照片墙记录
            DAL.Album.PhotoWallDAL dalPhotoWall   = new DAL.Album.PhotoWallDAL();
            Model.Album.PhotoWall  modelPhotoWall = new Model.Album.PhotoWall();

            modelPhotoWall.OpenId   = model.OpenId;
            modelPhotoWall.Name     = model.Name;
            modelPhotoWall.SiteCode = model.SiteCode;
            modelPhotoWall.OpenId   = model.OpenId;
            modelPhotoWall.FilePath = model.FilePath;
            modelPhotoWall.Remark   = model.Remark;
            modelPhotoWall.AddTime  = model.AddTime;

            dalPhotoWall.Insert(modelPhotoWall);

            //复制文件
            System.IO.FileInfo pFile = new System.IO.FileInfo(Server.MapPath("../User_Photo/" + strFilePath));
            if (pFile.Exists)
            {
                pFile.CopyTo(Server.MapPath("../WALL_Photo/" + strFilePath), true);
            }
            Response.Write("<script>alert('照片上传照片墙完成!');window.location.href='MyThumbList.aspx?SiteCode=" + strSiteCode + "&OpenID=" + strOpenID + "'</script>");
            //返回
            //Response.Redirect("MyThumbList.aspx?SiteCode=" + strSiteCode + "&OpenID=" + strOpenID);
        }