Exemplo n.º 1
0
        void showdetailinfo()
        {
            MSCustomersDAL CustomerDal   = new MSCustomersDAL();
            DataSet        ds            = CustomerDal.GetCustomerDetail(strID);
            MSCustomers    CustomerModel = DataConvert.DataRowToModel <MSCustomers>(ds.Tables[0].Rows[0]);

            phone.Text       = CustomerModel.Phone;
            hd_content.Value = CustomerModel.Pnote;
            NickName.Text    = CustomerModel.NickName;
            email.Text       = CustomerModel.Email;
            QQnum.Text       = CustomerModel.QQnum;
            if (CustomerModel.HeadImg != null && CustomerModel.HeadImg != "")
            {
                img0.Src = "../../PalmShop/ShopCode/" + CustomerModel.HeadImg;
                oldimg   = CustomerModel.HeadImg;
            }
            if (CustomerModel.Sex == 0)
            {
                isstateyes.Checked = true;
            }
            else
            {
                isstateno.Checked = true;
            }
            if (strAction == "show")
            {
                this.btnReset.Visible = false;
                this.btnSave.Visible  = false;
            }
        }
Exemplo n.º 2
0
        void GetHtmlPage()
        {
            MSShop      shopModel = new MSShop();
            MSCustomers UserModel = new MSCustomers();

            #region -----------------店铺详情-----------------------
            if (strSID != null && strSID != "")
            {
                MSShopDAL shopDal = new MSShopDAL();
                DataSet   shopds  = shopDal.GetMSShopDetail(strSID);
                if (shopds != null && shopds.Tables.Count > 0 && shopds.Tables[0].Rows.Count > 0)
                {
                    shopModel = DataConvert.DataRowToModel <MSShop>(shopds.Tables[0].Rows[0]);
                }
            }
            #endregion
            #region ---------------店铺用户资料详情--------------------
            if (strUid != null && strUid != "")
            {
                MSCustomersDAL UserDal = new MSCustomersDAL();
                DataSet        userds  = UserDal.GetCustomerDetail(strUid);
                if (userds != null && userds.Tables.Count > 0 && userds.Tables[0].Rows.Count > 0)
                {
                    UserModel = DataConvert.DataRowToModel <MSCustomers>(userds.Tables[0].Rows[0]);
                }
            }
            #endregion
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/ApplyShop.html"));
            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["footer"]      = "奥琦微商易";
            context.TempData["errorscript"] = errorscript;
            context.TempData["shopdetail"]  = shopModel;
            context.TempData["usredetail"]  = UserModel;
            context.TempData["action"]      = action;
            context.TempData["sid"]         = strSID;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Exemplo n.º 3
0
 void getTemplate()
 {
     #region --------------获取客户详细-----------------
     MSCustomers    customerModel = new MSCustomers();
     MSCustomersDAL customerDal   = new MSCustomersDAL();
     DataSet        customerDs    = customerDal.GetCustomerDetail(strUid);
     if (null != customerDs && customerDs.Tables.Count > 0 && customerDs.Tables[0].Rows.Count > 0)
     {
         customerModel = DataConvert.DataRowToModel <MSCustomers>(customerDs.Tables[0].Rows[0]);
         if (customerModel.HeadImg != null && customerModel.HeadImg != "")
         {
             oldimgname = customerModel.HeadImg;
         }
     }
     #endregion
     string text = System.IO.File.ReadAllText(Server.MapPath("HtmlPage/customerinfo.html"));
     JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
     JinianNet.JNTemplate.Template        t       = new JinianNet.JNTemplate.Template(context, text);
     context.TempData["customer"]    = customerModel;
     context.TempData["errorscript"] = errorscript;
     context.TempData["fid"]         = strfid;
     context.TempData["footer"]      = "奥琦微商易";
     t.Render(Response.Output);
 }
Exemplo n.º 4
0
        void GetProductDetail()
        {
            string ptitle    = string.Empty;
            string shopID    = string.Empty;
            string puid      = string.Empty;
            int    paracount = 0;

            #region 产品详细
            MSProductDAL productDal   = new MSProductDAL();
            MSProduct    productModel = new MSProduct();
            DataSet      productds    = productDal.GetProductDetail(strpid);
            if (null != productds && productds.Tables.Count > 0 && productds.Tables[0].Rows.Count > 0)
            {
                productModel = DataConvert.DataRowToModel <MSProduct>(productds.Tables[0].Rows[0]);
                ptitle       = productModel.Ptitle;
                puid         = productModel.CustomerID;
                if (productModel.SID != null && productModel.SID != "")
                {
                    shopID = productModel.SID;
                }
            }
            #endregion
            #region 店铺详细
            MSShop shopModel = new MSShop();
            if (shopID != null && shopID != "")
            {
                MSShopDAL shopDal = new MSShopDAL();
                DataSet   shopds  = shopDal.GetMSShopDetail(shopID);
                if (shopds != null && shopds.Tables.Count > 0 && shopds.Tables[0].Rows.Count > 0)
                {
                    shopModel = DataConvert.DataRowToModel <MSShop>(shopds.Tables[0].Rows[0]);
                }
            }
            #endregion
            #region 图集列表
            MSProductAtlasDAL     atlasDal       = new MSProductAtlasDAL();
            List <MSProductAtlas> AtlasListModel = new List <MSProductAtlas>();
            DataSet atlasds = atlasDal.GetProductAtlasByPID(strpid);
            if (null != atlasds && atlasds.Tables.Count > 0 && atlasds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in atlasds.Tables[0].Rows)
                {
                    MSProductAtlas atlasModel = DataConvert.DataRowToModel <MSProductAtlas>(row);
                    AtlasListModel.Add(atlasModel);
                }
            }
            #endregion
            #region 产品参数列表
            //MSProductParaDAL paraDal = new MSProductParaDAL();
            //DataSet paramds = paraDal.GetProductParamByPID(strpid);
            //string paramlist = string.Empty;
            //if (null != paramds && paramds.Tables.Count > 0 && paramds.Tables[0].Rows.Count > 0)
            //{
            //    for (int i = 0; i < paramds.Tables[0].Rows.Count; i++)
            //    {
            //        paramlist += "<tr>\r\n";
            //        string paraname = paramds.Tables[0].Rows[i]["ParName"].ToString();
            //        string paravalue = paramds.Tables[0].Rows[i]["ParValue"].ToString();
            //        paramlist += "<td class=\"td_title\">" + paraname + "</td><td>" + paravalue + "</td>\r\n";
            //        try
            //        {
            //            i = i + 1;
            //            paraname = paramds.Tables[0].Rows[i]["ParName"].ToString();
            //            paravalue = paramds.Tables[0].Rows[i]["ParValue"].ToString();
            //            paramlist += "<td class=\"td_title\">" + paraname + "</td><td>" + paravalue + "</td>\r\n";
            //        }
            //        catch (Exception)
            //        {
            //            paramlist += "<td class=\"td_title\">&nbsp;&nbsp;</td><td>&nbsp;&nbsp;</td>\r\n";
            //        }
            //        paramlist += "</tr>\r\n";
            //    }
            //}
            #endregion
            #region -------获取产品型号及价格------------
            ProductPara          ParaModel     = new ProductPara();
            List <MSProductPara> paralistmodel = new List <MSProductPara>();
            MSProductParaDAL     paraDal       = new MSProductParaDAL();
            DataSet parads = paraDal.GetMaxMinPrice(strpid);
            if (parads != null && parads.Tables.Count > 0 && parads.Tables[0].Rows.Count > 0)
            {
                paracount = parads.Tables[0].Rows.Count;
                ParaModel = DataConvert.DataRowToModel <ProductPara>(parads.Tables[0].Rows[0]);
            }
            parads = null;
            parads = paraDal.GetProductParamByPID(strpid);
            if (parads != null && parads.Tables.Count > 0 && parads.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow item in parads.Tables[0].Rows)
                {
                    MSProductPara paramodel = DataConvert.DataRowToModel <MSProductPara>(item);
                    paralistmodel.Add(paramodel);
                }
            }
            #endregion

            #region ----------------根据产品编号获取联系方式--------------------
            MSShopContactsDAL contactDal   = new MSShopContactsDAL();
            MSShopContacts    contactModel = new MSShopContacts();
            DataSet           contactDs    = contactDal.GetContactDetailByPID(strpid);

            MSCustomersDAL CustomerDal = new MSCustomersDAL();
            MSCustomers    CustomerModel = new MSCustomers();
            DataSet        PuidDs = null; int contactcount = 0;

            if (contactDs != null && contactDs.Tables.Count > 0 && contactDs.Tables[0].Rows.Count > 0)
            {
                contactModel = DataConvert.DataRowToModel <MSShopContacts>(contactDs.Tables[0].Rows[0]);
                contactcount = 1;
            }
            else
            {
                if (puid != null && puid != "")
                {
                    PuidDs = CustomerDal.GetCustomerDetail(puid);
                }
                if (PuidDs != null && PuidDs.Tables.Count > 0 && PuidDs.Tables[0].Rows.Count > 0)
                {
                    CustomerModel = DataConvert.DataRowToModel <MSCustomers>(PuidDs.Tables[0].Rows[0]);
                }
            }
            #endregion
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/Product_detail.html"));
            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"] = ptitle;
            if (shopModel != null)
            {
                context.TempData["shopdetail"] = shopModel;
            }
            context.TempData["productdetail"] = productModel;
            context.TempData["atlaslist"]     = AtlasListModel;
            if (contactcount > 0)
            {
                context.TempData["contactdetail"] = contactModel;
            }
            else
            {
                context.TempData["contactdetail"] = CustomerModel;
            }
            context.TempData["customid"] = customid;
            //context.TempData["paramlist"] = paramlist;
            context.TempData["paracount"]   = paracount;
            context.TempData["paramodel"]   = ParaModel;
            context.TempData["paralist"]    = paralistmodel;
            context.TempData["footer"]      = "奥琦微商易";
            context.TempData["errorscript"] = errorscript;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取购物信息
        /// </summary>
        void GetInfo()
        {
            #region 产品详细
            MSProductDAL      productDal       = new MSProductDAL();
            MSProduct         productModel     = new MSProduct();
            DataSet           productds        = productDal.GetProductDetail(strpid);
            MSProductAtlasDAL atlasDal         = new MSProductAtlasDAL();
            MSProductAtlas    atlasdetailmodel = null;
            DataSet           atlasDs          = null;
            if (null != productds && productds.Tables.Count > 0 && productds.Tables[0].Rows.Count > 0)
            {
                productModel = DataConvert.DataRowToModel <MSProduct>(productds.Tables[0].Rows[0]);
            }
            #endregion
            #region 获取产品默认展示图
            atlasDs = atlasDal.GetDefaultAtlasByPid(strpid);
            foreach (DataRow atlasrow in atlasDs.Tables[0].Rows)
            {
                atlasdetailmodel = DataConvert.DataRowToModel <MSProductAtlas>(atlasrow);
            }
            #endregion
            #region -----------获取型号尺码----------------
            MSProductPara    paraModel = new MSProductPara();
            MSProductParaDAL paraDal   = new MSProductParaDAL();
            DataSet          parads    = paraDal.GetParaDetail(mid);
            if (parads != null && parads.Tables.Count > 0 && parads.Tables[0].Rows.Count > 0)
            {
                paraModel = DataConvert.DataRowToModel <MSProductPara>(parads.Tables[0].Rows[0]);
            }
            #endregion
            #region 获取收货地址
            MSDeliveryAddressDAL     addressDal     = new MSDeliveryAddressDAL();
            MSDeliveryAddress        defaultadModel = new MSDeliveryAddress();
            List <MSDeliveryAddress> damodellist    = new List <MSDeliveryAddress>();
            string stradwhere = string.Empty;
            stradwhere = "and [UID]='" + customid + "' ";
            DataSet addressds = addressDal.GetDAList(3, stradwhere);
            if (null != addressds && addressds.Tables.Count > 0 && addressds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in addressds.Tables[0].Rows)
                {
                    MSDeliveryAddress damodel = DataConvert.DataRowToModel <MSDeliveryAddress>(row);
                    damodellist.Add(damodel);
                }
            }
            #endregion
            string      customerphone = string.Empty;
            MSCustomers customerModel = new MSCustomers();
            if (customid != null && customid != "")
            {
                MSCustomersDAL CustomerDal = new MSCustomersDAL();
                DataSet        customerds  = CustomerDal.GetCustomerDetail(customid);
                if (customerds != null && customerds.Tables.Count > 0 && customerds.Tables[0].Rows.Count > 0)
                {
                    customerModel = DataConvert.DataRowToModel <MSCustomers>(customerds.Tables[0].Rows[0]);
                }
            }

            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/setOrder.html"));
            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["productdetail"] = productModel;
            context.TempData["atlas"]         = atlasdetailmodel;
            context.TempData["paramodel"]     = paraModel;
            context.TempData["errorscript"]   = errorscript;
            context.TempData["dalist"]        = damodellist;
            context.TempData["customer"]      = customerModel;
            context.TempData["openid"]        = openid;
            context.TempData["footer"]        = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Exemplo n.º 6
0
 void getTemplate()
 {
     #region -----------获取客户信息---------
     MSCustomers    CustomerModel = new MSCustomers();
     MSCustomersDAL CustomerDal   = new MSCustomersDAL();
     DataSet        CustomerDs;
     if (strUid != null && strUid != "")
     {
         CustomerDs = CustomerDal.GetCustomerDetail(strUid);
         if (null != CustomerDs && CustomerDs.Tables.Count > 0 && CustomerDs.Tables[0].Rows.Count > 0)
         {
             CustomerModel = DataConvert.DataRowToModel <MSCustomers>(CustomerDs.Tables[0].Rows[0]);
             if (CustomerModel.NickName == null || CustomerModel.NickName == "" ||
                 CustomerModel.NickName.ToLower() == "null")
             {
                 CustomerModel.NickName = "游客";
             }
         }
     }
     #endregion
     #region ----------获取帖子列表----------------
     MSForumTopicDAL       topicDal       = new MSForumTopicDAL();
     List <TopicModelList> topicModellist = new List <TopicModelList>();
     int     topicCount  = 0;
     DataSet topiclistds = topicDal.GetMSForumTopicList(" and a.[UID]='" + strUid + "' ", 0);
     if (topiclistds != null && topiclistds.Tables.Count > 0 && topiclistds.Tables[0].Rows.Count > 0)
     {
         topicCount = topiclistds.Tables[0].Rows.Count;
         foreach (DataRow row in topiclistds.Tables[0].Rows)
         {
             TopicModelList topicmodel = DataConvert.DataRowToModel <TopicModelList>(row);
             if (topicmodel.NickName == null || topicmodel.NickName == "" || topicmodel.NickName.Length < 1)
             {
                 topicmodel.NickName = "游客";
             }
             if (topicmodel.HeadImg == null || topicmodel.HeadImg == "")
             {
                 topicmodel.HeadImg = "images/2.png";
             }
             string msg = topicmodel.TopicDesc;
             msg = JQDialog.GetTextFromHTML(msg);
             if (msg.Length > 250)
             {
                 msg = msg.ToString().Substring(0, 100) + "...";
             }
             topicmodel.TopicDesc = msg;
             topicModellist.Add(topicmodel);
         }
     }
     #endregion
     #region --------------获取喜欢 总数------------------
     int likecount = 0;
     MSForumTopicLoveDAL likeDal = new MSForumTopicLoveDAL();
     try
     {
         likecount = likeDal.GetLoveOrLikeCountByUID(strUid, "tlike");
     }
     catch (Exception)
     {
         likecount = 0;
     }
     #endregion
     #region ------------获取消息总数---------------
     int msgcount = 0;
     MSForumCommentDAL commentDal = new MSForumCommentDAL();
     try
     {
         msgcount = commentDal.GetCommentCountByUID(strUid);
     }
     catch (Exception)
     {
         msgcount = 0;
     }
     #endregion
     string text = System.IO.File.ReadAllText(Server.MapPath("HtmlPage/othertopiclist.html"));
     JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
     JinianNet.JNTemplate.Template        t       = new JinianNet.JNTemplate.Template(context, text);
     context.TempData["mytopiclist"] = topicModellist;
     context.TempData["topiccount"]  = topicCount;
     context.TempData["customer"]    = CustomerModel;
     context.TempData["fid"]         = strfid;
     context.TempData["likecount"]   = likecount;
     context.TempData["msgcount"]    = msgcount;
     context.TempData["errorscript"] = errorscript;
     context.TempData["uid"]         = strUid;
     context.TempData["myuid"]       = strMyUid;
     context.TempData["footer"]      = "奥琦微商易";
     t.Render(Response.Output);
 }
Exemplo n.º 7
0
 public void getTemplate()
 {
     #region -----------获取客户信息---------
     MSCustomers    CustomerModel = new MSCustomers();
     MSCustomersDAL CustomerDal   = new MSCustomersDAL();
     DataSet        CustomerDs;
     if (strUid != null && strUid != "")
     {
         CustomerDs = CustomerDal.GetCustomerDetail(strUid);
         if (null != CustomerDs && CustomerDs.Tables.Count > 0 && CustomerDs.Tables[0].Rows.Count > 0)
         {
             CustomerModel = DataConvert.DataRowToModel <MSCustomers>(CustomerDs.Tables[0].Rows[0]);
             if (CustomerModel.NickName == null || CustomerModel.NickName == "" ||
                 CustomerModel.NickName.ToLower() == "null")
             {
                 CustomerModel.NickName = "游客";
             }
         }
     }
     #endregion
     #region ---------评论列表以及信息回复------------
     List <CommentListGetSet> commentModelList = new List <CommentListGetSet>();
     MSForumCommentDAL        commentDal       = new MSForumCommentDAL();
     DataSet commentDs = commentDal.GetCommentList(" and a.[uid]='" + strUid + "' ");
     DataSet repcommentds;
     List <CommentListGetSet> repcommentModelList = new List <CommentListGetSet>();
     int commentcount = 0;
     if (commentDs != null && commentDs.Tables.Count > 0 && commentDs.Tables[0].Rows.Count > 0)
     {
         foreach (DataRow row in commentDs.Tables[0].Rows)
         {
             CommentListGetSet commentModel = DataConvert.DataRowToModel <CommentListGetSet>(row);
             if (commentModel.NickName == null || commentModel.NickName == "")
             {
                 commentModel.NickName = "游客";
             }
             #region ----------------获取回复信息-----------------------
             string repid = commentModel.ID;
             repcommentds = commentDal.GetRepCommentList(" and a.[uid]='" + strUid + "' and a.UpID='" + repid + "' ");
             if (repcommentds != null && repcommentds.Tables.Count > 0 && repcommentds.Tables[0].Rows.Count > 0)
             {
                 foreach (DataRow reprow in repcommentds.Tables[0].Rows)
                 {
                     CommentListGetSet repcommentModel = DataConvert.DataRowToModel <CommentListGetSet>(reprow);
                     if (repcommentModel.NickName == null || repcommentModel.NickName == "")
                     {
                         repcommentModel.NickName = "游客";
                     }
                     repcommentModelList.Add(repcommentModel);
                 }
             }
             #endregion
             commentModelList.Add(commentModel);
         }
     }
     try
     {
         commentcount = commentDs.Tables[0].Rows.Count;
     }
     catch (Exception)
     {
         commentcount = 0;
     }
     #endregion
     #region --------------获取喜欢 总数------------------
     int likecount = 0;
     MSForumTopicLoveDAL likeDal = new MSForumTopicLoveDAL();
     try
     {
         likecount = likeDal.GetLoveOrLikeCountByUID(strUid, "tlike");
     }
     catch (Exception)
     {
         likecount = 0;
     }
     #endregion
     #region ------------获取消息总数---------------
     int msgcount = 0;
     try
     {
         msgcount = commentDal.GetCommentCountByUID(strUid);
     }
     catch (Exception)
     {
         msgcount = 0;
     }
     #endregion
     #region ---------帖子总数-------------
     int             topiccount = 0;
     MSForumTopicDAL topicdal   = new MSForumTopicDAL();
     try
     {
         topiccount = topicdal.GetTopicCountByUID(strUid);
     }
     catch (Exception)
     {
         topiccount = 0;
     }
     #endregion
     string text = System.IO.File.ReadAllText(Server.MapPath("HtmlPage/Mycommentlist.html"));
     JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
     JinianNet.JNTemplate.Template        t       = new JinianNet.JNTemplate.Template(context, text);
     context.TempData["customer"]       = CustomerModel;
     context.TempData["commentlist"]    = commentModelList;
     context.TempData["repcommentlist"] = repcommentModelList;
     context.TempData["fid"]            = strfid;
     context.TempData["likecount"]      = likecount;
     context.TempData["msgcount"]       = msgcount;
     context.TempData["topiccount"]     = topiccount;
     context.TempData["errorscript"]    = errorscript;
     context.TempData["uid"]            = strUid;
     context.TempData["footer"]         = "奥琦微商易";
     t.Render(Response.Output);
 }