Example #1
0
        void showdetailinfo()
        {
            MSProductParaDAL ParaDal   = new MSProductParaDAL();
            DataSet          ParaDs    = ParaDal.GetParaDetail(strID);
            MSProductPara    ParaModel = DataConvert.DataRowToModel <MSProductPara>(ParaDs.Tables[0].Rows[0]);

            paraname.Text = ParaModel.ParName;
            //paravalue.Text = ParaModel.ParValue;
            if (strAction == "show")
            {
                this.btnReset.Visible = false;
                this.btnSave.Visible  = false;
            }
        }
Example #2
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);
        }