Ejemplo n.º 1
0
 /// <summary>
 /// 获取存储在Session或Cookie中Admin的信息
 /// </summary>
 /// <returns></returns>
 public static AdminInfo Get()
 {
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     if (sp.IsSession)
     {
         if (HttpContext.Current.Session["Admin"] != null)
         {
             return (AdminInfo)HttpContext.Current.Session["Admin"];
         }
         else
         {
             return null;
         }
     }
     else
     {
         string AdminId = ChangeHope.Common.Cookies.getCookie("AdminId", "Value");
         if (AdminId != null)
         {
             string AdminName = ChangeHope.Common.Cookies.getCookie("AdminName", "Value");
             string AdminPowerType = ChangeHope.Common.Cookies.getCookie("AdminPowerType", "Value");
             string AdminRole = ChangeHope.Common.Cookies.getCookie("AdminRole", "Value");
             AdminInfo model = new AdminInfo();
             model.AdminId = int.Parse(AdminId);
             model.AdminName = AdminName;
             model.AdminPowerType = AdminPowerType;
             model.AdminRole = AdminRole;
             return model;
         }
         else
         {
             return null;
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 清除存储在Session或Cookie中Admin的信息
        /// </summary>
        /// <returns></returns>
        public static void DelAdminInfo()
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            if (sp.IsSession)
            {
                if (HttpContext.Current.Session["Admin"] != null)
                {
                    HttpContext.Current.Session.Abandon();
                }
            }
            else
            {
                string AdminId = ChangeHope.Common.Cookies.getCookie("AdminId", "Value");
                if (AdminId != null)
                {
                    HttpCookie cookieAdminId = HttpContext.Current.Request.Cookies["AdminId"];
                    cookieAdminId.Expires = DateTime.Now.AddDays(-1);
                    HttpContext.Current.Response.Cookies.Add(cookieAdminId);

                    HttpCookie cookieAdminName = HttpContext.Current.Request.Cookies["AdminName"];
                    cookieAdminName.Expires = DateTime.Now.AddDays(-1);
                    HttpContext.Current.Response.Cookies.Add(cookieAdminName);

                    HttpCookie cookieAdminPowerType = HttpContext.Current.Request.Cookies["AdminPowerType"];
                    cookieAdminPowerType.Expires = DateTime.Now.AddDays(-1);
                    HttpContext.Current.Response.Cookies.Add(cookieAdminPowerType);

                    HttpCookie cookieAdminRole = HttpContext.Current.Request.Cookies["AdminRole"];
                    cookieAdminRole.Expires = DateTime.Now.AddDays(-1);
                    HttpContext.Current.Response.Cookies.Add(cookieAdminRole);
                }
            }
        }
 /// <summary>
 /// 验证
 /// </summary>
 private void InitWebControl()
 {
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     //this.txtProductClass.Attributes.Add("readonly", "readonly");
     //this.txtProductClass.Attributes.Add("onclick", "selectFile('Productclass',new Array(" + this.hfcid.ClientID + "," + this.txtProductClass.ClientID + "),310,450,'" + sp.DummyPaht + "');");
     ChangeHope.WebPage.WebControl.Validate(this.txtName, "输入商品的属性名称,您再添加商品时会自动加载该属性.", "isnull", "必填", "该项为必填项");
     ChangeHope.WebPage.WebControl.Validate(this.txtSort, "输入数字将作为显示的排列顺序", "isint", "必填", "该项为必填项");
     this.Form.Attributes.Add("onsubmit", "return CheckForm()");
 }
        protected void BeginCreate()
        {
            string adurl = string.Empty;
            string width = string.Empty;
            string height = string.Empty;
            string picurl = string.Empty;
            string content = string.Empty;
            string jsname = string.Empty;
            string AdType = string.Empty;
            ShowShop.BLL.Accessories.AdvertiseManage bll = new ShowShop.BLL.Accessories.AdvertiseManage();
            ShowShop.Common.SysParameter sysParm = new ShowShop.Common.SysParameter();
            string ads_id = ChangeHope.WebPage.PageRequest.GetQueryString("Ads_ID");
            if (ads_id != "" && ads_id != null)
            {
                ShowShop.Model.Accessories.AdvertiseManage model = bll.GetModelByID(Convert.ToInt32(ads_id));
                if (model != null)
                {
                    adurl = model.LinkAddress;
                    width = model.SizeBreadth.ToString();
                    height = model.Hight.ToString();
                    picurl = sysParm.DummyPaht + model.UpspreadAdd;
                    content = model.Advertisecont;
                    jsname = model.Name;
                    AdType = model.Adtype.ToString();
                    CreateJs(adurl, width, height, picurl, content, jsname, Convert.ToInt16(AdType));

                    this.ltlMsg.Text = "操作成功,已生成"+model.Name+".JS广告";
                    this.pnlMsg.Visible = true;
                    this.pnlMsg.CssClass = "actionOk";
                }
            }
            else
            {
                List<ShowShop.Model.Accessories.AdvertiseManage> modeList = bll.GetAll();
                if (modeList.Count > 0)
                {
                    int i = 0;
                    foreach (ShowShop.Model.Accessories.AdvertiseManage model in modeList)
                    {
                        adurl = model.LinkAddress;
                        width = model.SizeBreadth.ToString();
                        height = model.Hight.ToString();
                        picurl = sysParm.DummyPaht + model.UpspreadAdd;
                        content = model.Advertisecont;
                        jsname = model.Name;
                        AdType = model.Adtype.ToString();
                        CreateJs(adurl, width, height, picurl, content, jsname, Convert.ToInt16(AdType));
                        i++;
                    }
                    this.ltlMsg.Text = "操作成功,共生成" + i.ToString() + "个广告";
                    this.pnlMsg.Visible = true;
                    this.pnlMsg.CssClass = "actionOk";
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected string GetList()
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            ShowShop.BLL.OrderCard.OrderCardInfo data = new ShowShop.BLL.OrderCard.OrderCardInfo();
            ChangeHope.DataBase.DataByPage dataPage = data.GetList();
            //第一步先添加表头
            table.AddHeadCol("4%", "序号");
            table.AddHeadCol("11%", "类型");
            table.AddHeadCol("15%", "卡号");
            table.AddHeadCol("5%", "面值");
            table.AddHeadCol("5%", "点数");
            table.AddHeadCol("14%", "所属商品");
            table.AddHeadCol("8%", "状态");
            table.AddHeadCol("10%", "截止日期");
            table.AddHeadCol("9%", "使用会员");
            table.AddHeadCol("10%", "获取时间");
            table.AddHeadCol("15%", "操作");
            table.AddRow();
            //添加表的内容
            if (dataPage.DataReader != null)
            {
                int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
                if (curpage < 0)
                {
                    curpage = 1;
                }
                int count = 0;
                while (dataPage.DataReader.Read())
                {
                    count++;
                    string No = (15 * (curpage - 1) + count).ToString();
                    table.AddCol(No);
                    table.AddCol(dataPage.DataReader["type"].ToString() == "1" ? "本商城充值卡" : "其它公司充值卡");
                    table.AddCol(dataPage.DataReader["cardnumber"].ToString());
                    table.AddCol(dataPage.DataReader["facevalue"].ToString());
                    table.AddCol(dataPage.DataReader["point"].ToString() + dataPage.DataReader["unit"].ToString());
                    table.AddCol(dataPage.DataReader["iswebsitersale"].ToString() == "1" ? ProductName(dataPage.DataReader["productid"].ToString()) : "不通过商城出售");
                    table.AddCol(Convert.ToDateTime(dataPage.DataReader["expirationdate"].ToString()) < System.DateTime.Now ? "已失效" : this.State(dataPage.DataReader["whetherRelease"].ToString(), dataPage.DataReader["productid"].ToString()));
                    table.AddCol(Convert.ToDateTime(dataPage.DataReader["expirationdate"].ToString()).ToString("yyyy-MM-dd"));
                    table.AddCol(dataPage.DataReader["username"].ToString());
                    table.AddCol(Convert.ToDateTime(dataPage.DataReader["fullmoneydate"].ToString()) != Convert.ToDateTime("1753-01-01") ? Convert.ToDateTime(dataPage.DataReader["fullmoneydate"].ToString()).ToString("yyyy-MM-dd") : "");

                    table.AddCol(string.Format("<a href=ordercard_edit.aspx?id={0}>编辑</a> <a href='#' onclick='Del({0})'>删除</a>", dataPage.DataReader["id"].ToString()));

                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;
            dataPage.Dispose();
            dataPage = null;
            return view;
        }
Ejemplo n.º 6
0
        string select_iframelist(string sh, string wd)
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            string liststr = "";
            string srcstr = "";
            string rq = Request.QueryString["FileType"];
            string arrrq = rq.Split('|')[0];
            switch (arrrq)
            {
                case "Product_info_class":
                    srcstr = sp.DummyPaht + "admin/include/product_info_class.aspx";
                    break;
                case "Productclass":
                    srcstr = sp.DummyPaht + "admin/include/productclass.aspx";
                    break;
                case "Label_Url_Productclass":
                    srcstr = sp.DummyPaht + "admin/include/label_url_productclass.aspx";
                    break;
                case "productclassone":
                    srcstr = sp.DummyPaht + "admin/include/productclassone.aspx";
                    break;
                case "Random_Productclass"://随意选择分类
                    srcstr = sp.DummyPaht + "admin/include/sel_productclass.aspx";
                    break;
                case "Area":
                    srcstr = sp.DummyPaht + "admin/include/selarea.aspx";
                    break;
                case "Product":
                    srcstr = sp.DummyPaht + "admin/include/selproductinfo.aspx?w_s_pro_Designation=1";
                    break;
                case "OrderCardProduct":
                    srcstr = sp.DummyPaht + "admin/include/selproductinfo.aspx?w_s_pro_Designation=7";
                    break;
                case "integratepurchasProduct":
                    srcstr = sp.DummyPaht + "admin/include/selproductinfo.aspx?w_s_pro_Designation=3";
                    break;
                case "AuctionProduct":
                    srcstr = sp.DummyPaht + "admin/include/selproductinfo.aspx?w_s_pro_Designation=5";
                    break;
                case "Memberlist":
                    srcstr = sp.DummyPaht + "admin/include/memberlist.aspx";
                    break;
                case "ShopStyle":
                    srcstr = sp.DummyPaht + "admin/include/shopstyle.aspx";
                    break;
                default:
                    break;
            }
            liststr += "<iframe src=\"" + srcstr + "\" frameborder=\"0\" id=\"select_main\" scrolling=\"yes\" name=\"select_main\" width=\""+wd+"px\" height=\"" + sh + "px\" />";

            return liststr;
        }
Ejemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string a = "000001";
     int b = Convert.ToInt32(a);
     int i=99999;
     //string a ="2012" +i.ToString("00000");
     if (!IsPostBack)
     {
       ShowShop.Common.AdministrorManager.CheckAdmin();
       ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
       WebName = sp.WebSiteName;
       WebTitle = sp.WebSiteTitle;
     }
 }
 /// <summary>
 /// 列表
 /// </summary>
 /// <returns></returns>
 public string GetList()
 {
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     ChangeHope.WebPage.Table table= new ChangeHope.WebPage.Table();
     ShowShop.BLL.SystemInfo.TerraceManage tmDate = new ShowShop.BLL.SystemInfo.TerraceManage();
     ChangeHope.DataBase.DataByPage datePage = tmDate.GetAllList();
     //添加头
     table.AddHeadCol("8%", "<input id=\"chall\" type=\"checkbox\" onclick=\"SelectAll(chall)\" />全选");
     table.AddHeadCol("6%", "排序");
     table.AddHeadCol("15%", "平台名称");
     table.AddHeadCol("10%", "支付平台");
     table.AddHeadCol("8%", "发布类型");
     table.AddHeadCol("7%", "发布人");
     table.AddHeadCol("", "商户ID");
     table.AddHeadCol("8%", "手续费率");
     table.AddHeadCol("16%", "常规操作");
     table.AddRow();
     //添加内容
     if(datePage.DataReader != null){
         int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
         if (curpage < 0)
         {
             curpage = 1;
         }
         int count = 0;
         while(datePage.DataReader.Read()){
             count++;
             string No = (15 * (curpage - 1) + count).ToString();
             table.AddCol("<input id=\"cbTm\"  type=\"checkbox\" value=" + datePage.DataReader["payment_id"] + " />");
            // table.AddCol(datePage.DataReader["payment_taxis"].ToString());
             table.AddCol(No);
             table.AddCol(datePage.DataReader["payment_name"].ToString());
             table.AddCol(PaymentByID(Convert.ToInt32(datePage.DataReader["payment_garden"])));
             table.AddCol(datePage.DataReader["payment_putouttypeid"].ToString()=="0"?"管理员":"会员");
             //这里需要会员信息
             table.AddCol(IsInsiderOrAdmin(Convert.ToInt32(datePage.DataReader["payment_putoutid"]),datePage.DataReader["payment_putouttypeid"].ToString()=="0"?true:false));
             table.AddCol(datePage.DataReader["payment_seller"].ToString());
             table.AddCol(datePage.DataReader["payment_expenses"].ToString()+"");
             table.AddCol("<a href='paymentmanage_edit.aspx?Payment_ID=" + datePage.DataReader["payment_id"] + "'>编辑</a>  <a href=\"#\" onclick='Del(" + datePage.DataReader["payment_id"] + ")'> 删除</a>&nbsp;" + PaymentById(Convert.ToInt32(datePage.DataReader["payment_garden"])));
             table.AddRow();
         }
     }
     string view = table.GetTable() + datePage.PageToolBar;
     datePage.Dispose();
     datePage = null;
     return view;
 }
Ejemplo n.º 9
0
 protected void GetMemberRankList(string ShopPrice, string MemberPrice)
 {
     if (ShopPrice == "")
     {
         ShopPrice = "0.00";
     }
     string[] strMemberPrice = MemberPrice.Split('|');
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
     ShowShop.BLL.Member.MemberRank data = new ShowShop.BLL.Member.MemberRank();
     List<ShowShop.Model.Member.MemberRank> list = data.GetAllMemberRank();
     //第一步先添加表头
     table.AddHeadCol("30%", "会员等级");
     table.AddHeadCol("40%", "价格");
     table.AddHeadCol("30%", "默认");
     table.AddRow();
     //添加表的内容
     if (list.Count > 0)
     {
         int col = 0;
         foreach (ShowShop.Model.Member.MemberRank va in list)
         {
             col++;
             table.AddCol("<input type='hidden' id='rankId" + col + "' name ='rankId" + col + "' value='" + va.Id + "'/>" + va.Name);
             if(MemberPrice!=""&&MemberPrice!=string.Empty)
             {
             foreach (string mp in strMemberPrice)
             {
                 string[] memberPr = mp.Split(',');
                 if (memberPr[0].ToString()==va.Id.ToString())
                 {
                     table.AddCol("<input type='text' name='rankName" + col + "' id='rankName" + col + "' value='" + memberPr [1]+ "'/>");
                 }
             }
             }
             else
             {
                 table.AddCol("<input type='text' name='rankName" + col + "' id='rankName" + col + "'/>");
             }
             table.AddCol(((Convert.ToDouble(ShopPrice) * Convert.ToDouble(va.Discount)) / 100).ToString("f2"));
             table.AddRow();
         }
         this.hfMemberPrice.Value = col.ToString();
     }
     string view = table.GetTable();
     this.Literal1.Text = view;
 }
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected string GetList()
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            ShowShop.BLL.Accessories.Top_Searches data = new ShowShop.BLL.Accessories.Top_Searches();
            ChangeHope.DataBase.DataByPage dataPage = data.GetList();
            //第一步先添加表头
            table.AddHeadCol("10%", "序号");
            table.AddHeadCol("40%", "名称");
            table.AddHeadCol("15%", "排序");
            table.AddHeadCol("20%", "状态");
            table.AddHeadCol("25%", "操作");
            table.AddRow();
            //添加表的内容
            if (dataPage.DataReader != null)
            {
                int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
                if (curpage < 0)
                {
                    curpage = 1;
                }
                int count = 0;
                while (dataPage.DataReader.Read())
                {
                    count++;
                    string No = (15 * (curpage - 1) + count).ToString();
                    table.AddCol("No."+No);
                    table.AddCol("<span style='cursor:hand');\">" + dataPage.DataReader["name"].ToString() + "</span>");
                    table.AddCol(string.Format("<input id='sort{0}' value='{1}' size='5' onblur='Sort({0},{1})'/>", dataPage.DataReader["id"].ToString(), dataPage.DataReader["sort"].ToString()));
                    table.AddCol(string.Format("<img src='../images/{0}.gif'/>", dataPage.DataReader["isshow"].ToString()));
                    table.AddCol(string.Format("<a href=topsearchesseting_edit.aspx?id={0}>编辑</a> <a href='#' onclick='Del({0})'>删除</a>", dataPage.DataReader["id"].ToString()));

                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;
            dataPage.Dispose();
            dataPage = null;
            return view;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected void GetList(string PutoutType)
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            ShowShop.BLL.Product.ProductInfo data = new ShowShop.BLL.Product.ProductInfo();
            ChangeHope.DataBase.DataByPage dataPage = data.GetList("[order by] ProductID desc", 20, "");
            //第一步先添加表头
            table.AddHeadCol("5%", "<input type=\"checkbox\" id=\"chkAll\" onclick=\"CheckAll(this.form)\" alt=\"全选/取消\" />选择");
            table.AddHeadCol("10%", "商品编号");
            table.AddHeadCol("18%", "商品名称");
            table.AddHeadCol("15%", "所属分类");
            table.AddHeadCol("10%", "品牌");
            table.AddHeadCol("14%", "创建时间");
            table.AddHeadCol("8%", "上架状态");
            table.AddHeadCol("20%", "操作");
            table.AddRow();
            //添加表的内容
            if (dataPage.DataReader != null)
            {
                while (dataPage.DataReader.Read())
                {
                    string pic_url = sp.DummyPaht + dataPage.DataReader["Thumbnail"].ToString();
                    table.AddCol("<input ID=\"cBox\" type=\"checkbox\" value=\"" + dataPage.DataReader["ProductID"].ToString() + "\" />");
                    table.AddCol(dataPage.DataReader["ProductNo"].ToString());
                    table.AddCol("<span style='cursor:hand'  onMouseOut=\"hiddenPic();\" onMouseMove=\"showPic('" + pic_url + "');\">" + dataPage.DataReader["ProductName"].ToString() + "(" + dataPage.DataReader["ProductAttachName"].ToString() + ")</span>");
                    table.AddCol(ProductClassName(dataPage.DataReader["cid"].ToString()));
                    table.AddCol(dataPage.DataReader["BrandID"].ToString());
                    table.AddCol(dataPage.DataReader["CreateTime"].ToString());
                    table.AddCol(dataPage.DataReader["IsShelves"].ToString() == "1" ? "上架" : "未上架");
                    table.AddCol(string.Format("<a href=product_info_edit.aspx?productNo={0}>编辑</a> <a href='#' onclick='Del({0})'>删除</a> <a href=product_info_edit.aspx?productNo={0}>属性添加</a> <a href='../../product/productcontent.aspx?q_productid={0}' target='_blank'>SKU添加</a>", dataPage.DataReader["ProductID"].ToString(), dataPage.DataReader["cid"].ToString(), PutoutType));

                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;
            dataPage.Dispose();
            dataPage = null;
            this.Literal1.Text = view;
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected string GetList()
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            ShowShop.BLL.Product.ProductBrand data = new ShowShop.BLL.Product.ProductBrand();
            ChangeHope.DataBase.DataByPage dataPage = data.GetList();
            //第一步先添加表头
            table.AddHeadCol("5%", "序号");
            table.AddHeadCol("25%", "品牌名称");
            table.AddHeadCol("25%", "排序");
            table.AddHeadCol("25%", "操作");
            table.AddRow();
            //添加表的内容
            if (dataPage.DataReader != null)
            {
                int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
                if (curpage < 0)
                {
                    curpage = 1;
                }
                int count = 0;
                while (dataPage.DataReader.Read())
                {
                    count++;
                    string No = (15 * (curpage - 1) + count).ToString();
                    table.AddCol(No);
                      table.AddCol(dataPage.DataReader["name"].ToString());
                    table.AddCol(string.Format("<input id='sort{0}' value='{1}' size='5' onblur='Sort({0},{1})'/>", dataPage.DataReader["bid"].ToString(), dataPage.DataReader["sort"].ToString()));
                    table.AddCol(string.Format("<a href=productbrand_edit.aspx?id={0}>编辑</a> <a href='#' onclick='Del({0})'>删除</a>", dataPage.DataReader["bid"].ToString()));

                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;
            dataPage.Dispose();
            dataPage = null;
            return view;
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected string GetList()
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            ShowShop.BLL.Member.Role data = new ShowShop.BLL.Member.Role();
            ChangeHope.DataBase.DataByPage dataPage = data.GetList();
            //第一步先添加表头
            table.AddHeadCol("10%", "序号");
            table.AddHeadCol("25%", "角色名");
            table.AddHeadCol("40%", "描述");
            table.AddHeadCol("25%", "操作");
            table.AddRow();
            //添加表的内容
            if (dataPage.DataReader != null)
            {
                int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
                if (curpage < 0)
                {
                    curpage = 1;
                }
                int count = 0;
                while (dataPage.DataReader.Read())
                {
                    count++;
                    string No = (15 * (curpage - 1) + count).ToString();
                    table.AddCol("No."+No);
                    table.AddCol( dataPage.DataReader["name"].ToString() );
                    table.AddCol(dataPage.DataReader["description"].ToString());
                    table.AddCol(string.Format("<a href=role_edit.aspx?id={0}>编辑</a> <a href='role_setmember.aspx?id={0}'>设置成员</a> <a href='popedom_manage.aspx?id={0}'>权限管理</a> <a href='#' onclick='Del({0})'>删除</a>", dataPage.DataReader["id"].ToString()));

                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;
            dataPage.Dispose();
            dataPage = null;
            return view;
        }
Ejemplo n.º 14
0
 /// <summary>
 /// 获取列表
 /// </summary>
 private void GetList()
 {
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
     ShowShop.BLL.Order.ShoppingCard data = new ShowShop.BLL.Order.ShoppingCard();
     ChangeHope.DataBase.DataByPage dataPage = data.GetProfilesList("");
     //第一步先添加表头
     table.AddHeadCol("10%", "序号");
     table.AddHeadCol("50%", "购者名称");
     table.AddHeadCol("25%", "购物时间");
     table.AddHeadCol("15%", "操作");
     table.AddRow();
     //添加表的内容
     if (dataPage.DataReader != null)
     {
         int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
         if (curpage < 0)
         {
             curpage = 1;
         }
         int count = 0;
         while (dataPage.DataReader.Read())
         {
             count++;
             string No = (15 * (curpage - 1) + count).ToString();
             table.AddCol(No);
             table.AddCol(string.Format("<a href='order_shop_view.aspx?q_uniqueid={1}&UserName={0}'>{0}</a>", dataPage.DataReader["username"].ToString(), dataPage.DataReader["uniqueid"].ToString()));
             table.AddCol(dataPage.DataReader["lastupdateddate"].ToString());
             table.AddCol(string.Format("<a href='#' onclick=\"Del('{0}')\">删除</a>", dataPage.DataReader["username"].ToString()));
             table.AddRow();
         }
     }
     string view = table.GetTable() + dataPage.PageToolBar;
     dataPage.Dispose();
     dataPage = null;
     this.ltlList.Text = view;
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 列表
 /// </summary>
 /// <returns></returns>
 protected void GetList()
 {
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
     ShowShop.BLL.Product.ProductInfo data = new ShowShop.BLL.Product.ProductInfo();
     ChangeHope.DataBase.DataByPage dataPage = data.GetList();
     //第一步先添加表头
     table.AddHeadCol("10%","序号");
     table.AddHeadCol("20%","货号");
     table.AddHeadCol("65%", "商品名称");
     table.AddHeadCol("10%", "库存");
     table.AddRow();
     //添加表的内容
     if (dataPage.DataReader != null)
     {
         int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
         if (curpage < 0)
         {
             curpage = 1;
         }
         int count = 0;
         while (dataPage.DataReader.Read())
         {
             count++;
             string No = (15 * (curpage - 1) + count).ToString();
             table.AddCol(No + "<input ID=\"cBox\" type=\"checkbox\" value=\"" + dataPage.DataReader["pro_ID"].ToString() + "\" />");
             table.AddCol(dataPage.DataReader["pro_NO"].ToString());
             table.AddCol("" + dataPage.DataReader["pro_Name"].ToString() + "");
             table.AddCol(string.Format("{0}{1}", dataPage.DataReader["pro_Stock"].ToString(), dataPage.DataReader["pro_Unit"].ToString()));
             table.AddRow();
         }
     }
     string view = table.GetTable() + dataPage.PageToolBar;
     dataPage.Dispose();
     dataPage = null;
     this.Literal1.Text = view;
 }
        private void GetFileList1()
        {
            /*
            修改人:ym
            修改时间:2009-8-26
            修改内容:添加
             */
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            ChangeHope.Common.FileHelper file = new ChangeHope.Common.FileHelper();

            StringBuilder filelist = new StringBuilder();
            file.rootUrl = Server.MapPath("~/"+ sp.WebSiteTemplatePath);
            file.listFiles(file.rootUrl, 0);

            filelist.AppendLine("<script type=\"text/javascript\">");
            filelist.AppendLine("d = new dTree('d');");
            filelist.AppendLine("d.add(0,-1,'请选择模版');");
            filelist.AppendLine(file.fileTree.ToString());
            filelist.AppendLine("document.write(d);");
            filelist.AppendLine("$(\"fileLists\").style.visibility=\"hidden\";");
            filelist.AppendLine("</script>");
            this.ltlFileList.Text = filelist.ToString();
            file = null;
        }
 private string SliedAd(string Address,int id)
 {
     string[] imagess = Address.Split('|');
     StringBuilder str = new StringBuilder();
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     int j = 1;
     if (imagess.Length > 0)
     {
         str.Append("<table><tr><td><input type=\"hidden\" name=\"hfImagesAddress\" id=\"hfImagesAddress\" value=\"" + Address+ "\" /></td></tr></table><table>");
         for (int i = 0; i < imagess.Length; i++)
         {
             if (!string.IsNullOrEmpty(imagess[i]))
             {
                 str.Append("<td align='center'><img width=\"100px\" height=\"100px\" src=\"" + sp.DummyPaht + imagess[i] + "\"/><br/><br/><span onclick=\"DelImages('" + imagess[i] + "'," + id + ");\"  style=\"cursor:hand;width:45px\" >删除</span></td>");
             }
             if (j % 6 == 0)
             {
                 str.Append("</tr><tr>");
             }
             j++;
         }
         str.Append("</table>");
     }
     return str.ToString();
 }
 private string DelImages(string Images,string DelPath,int id)
 {
     ShowShop.BLL.Accessories.AdvertiseManage bll = new ShowShop.BLL.Accessories.AdvertiseManage();
     string[] imagess = Images.Split('|');
     StringBuilder str = new StringBuilder();
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     int j = 1;
     string img = "";
     if (imagess.Length > 0)
     {
         str.Append("<table>");
         for (int i = 0; i < imagess.Length; i++)
         {
             if (imagess[i] != DelPath && !string.IsNullOrEmpty(imagess[i]))
             {
                 if (img == "")
                 {
                     img = imagess[i];
                 }
                 else
                 {
                     img += "|" + imagess[i];
                 }
                 str.Append("<td align='center'><img width=\"100px\" height=\"100px\" src=\"" + sp.DummyPaht + imagess[i] + "\"/><br/><br/><span onclick=\"DelImages('" + imagess[i] + "'," + id + ");\"  style=\"cursor:hand;width:45px\" >删除</span></td>");
                 if (j % 6 == 0)
                 {
                     str.Append("</tr><tr>");
                 }
                 j++;
             }
             else
             {
                 ChangeHope.Common.FileHelper fh = new ChangeHope.Common.FileHelper();
                 fh.DeleteFile(Server.MapPath("~\\" + DelPath));
             }
         }
         bll.Amend(id, "upspreadadd", img);
         str.Append("</table><table><tr><td><input type=\"hidden\" name=\"hfImagesAddress\" id=\"hfImagesAddress\" value=\"" + img + "\" /></td></tr></table>");
     }
     return str.ToString();
 }
        protected void Save()
        {
            ShowShop.Common.SysParameter sp=new ShowShop.Common.SysParameter();
            ShowShop.BLL.Accessories.AdvertiseManage bll = new ShowShop.BLL.Accessories.AdvertiseManage();
            ShowShop.Model.Accessories.AdvertiseManage model = new ShowShop.Model.Accessories.AdvertiseManage();
            string typeId = this.hfAdTypeId.Value;
            string adId = this.hfAdId.Value;
            switch (typeId)
            {
                case "0"://图片
                    model.Name = this.txt_image_Add_Name.Text.Trim();
                    model.Power = this.txt_images_Power.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_images_Power.Text.Trim());
                    model.BrowseCount = this.txt_images_BrowseCount.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_images_BrowseCount.Text.Trim());
                    model.ClickCount = this.txt_images_ClickCount.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_images_ClickCount.Text.Trim());
                    model.OverdueTime = Convert.ToDateTime(this.dpStart_images.Text.Trim());
                    model.Examine = this.chx_images_Examine.Checked ? 1 : 0;
                    model.StatClick = this.chx_images_ClickCount.Checked ? 1 : 0;
                    model.StatBrowse = this.chx_images_BorwsCount.Checked ? 1 : 0;

                    model.SizeBreadth = txt_images_Width.Text.Trim();
                    model.Hight = txt_images_Height.Text.Trim();
                    model.LinkAddress = txt_images_LinkAddress.Text.Trim();
                    model.Hint = txt_images_Hint.Text.Trim();
                    //打开方式
                    model.BackgorTarget = Convert.ToInt32(this.rdolstTarget1.SelectedValue);
                    model.Advertisecont = txtContent1.Text.Trim();
                    model.Adtype = 0;
                    string images_path = "";
                    if (fu_images.PostedFile.ContentLength > 1)
                    {
                        ChangeHope.Common.UploadFile uf = new ChangeHope.Common.UploadFile();
                        uf.ExtensionLim = ".gif,.jpg,.jpeg,.dmp";
                        uf.FileLengthLim = sp.ImageSize;
                        uf.PostedFile = this.fu_images;
                        uf.SavePath = "/yxuploadfile/accessories/advertise";
                        string errorInfo = "";

                        if (uf.Upload())
                        {
                            if (uf.HaveLoad)
                            {
                                if (!string.IsNullOrEmpty(adId) && ViewState["Images"] != null)
                                {
                                    ChangeHope.Common.FileHelper fh = new ChangeHope.Common.FileHelper();
                                    fh.DeleteFile(Server.MapPath("~\\" + ViewState["Images"].ToString()));
                                }
                                images_path = uf.FilePath;
                            }
                            else
                            {

                                errorInfo = uf.Message;
                            }
                        }
                        else
                        {
                            errorInfo = uf.Message;
                        }
                        if (images_path == "")
                        {
                            this.ltlMsg.Text = "操作失败," + errorInfo + "";
                            this.pnlMsg.Visible = true;
                            this.pnlMsg.CssClass = "actionErr";
                            return;
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(adId) && ViewState["Images"] != null)
                        {
                            images_path = ViewState["Images"].ToString();
                        }
                    }

                    model.UpspreadAdd = images_path;
                    if (string.IsNullOrEmpty(adId))
                    {
                        if (bll.Add(model) > 0)
                        {
                            ChangeHope.WebPage.BasePage.PageRight("图片广告已保存。", "advertise_info_edit.aspx");
                        }
                    }
                    else
                    {
                        model.ID = Convert.ToInt32(adId);
                        bll.Amend(model);
                        ChangeHope.WebPage.BasePage.PageRight("图片广告修改成功。", "advertise_list.aspx");
                    }
                    break;
                case "1"://动画

                    model.Name = this.txt_flash_Add_Name.Text.Trim();
                    model.Power = this.txt_flash_Power.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_flash_Power.Text.Trim());
                    model.BrowseCount = this.txt_flash_BrowseCount.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_flash_BrowseCount.Text.Trim());
                    model.ClickCount = this.txt_flash_ClickCount.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_flash_ClickCount.Text.Trim());
                    model.OverdueTime = Convert.ToDateTime(this.dpStart_flash.Text.Trim());
                    model.Examine = this.chx_flash_Examine.Checked ? 1 : 0;
                    model.StatClick = this.chx_flash_ClickCount.Checked ? 1 : 0;
                    model.StatBrowse = this.chx_flash_BorwsCount.Checked ? 1 : 0;
                    string flash_path = string.Empty;
                    if (this.fu_flash.PostedFile.ContentLength > 0)
                    {
                        ChangeHope.Common.UploadFile uf_falsh = new ChangeHope.Common.UploadFile();
                        uf_falsh.ExtensionLim = ".gif,.swf";
                        uf_falsh.FileLengthLim = sp.ImageSize;
                        uf_falsh.PostedFile = this.fu_flash;
                        uf_falsh.SavePath = "/yxuploadfile/accessories/advertise";
                        if (uf_falsh.Upload())
                        {
                            if (uf_falsh.HaveLoad)
                            {
                                if (!string.IsNullOrEmpty(adId) && ViewState["Images"] != null)
                                {
                                    ChangeHope.Common.FileHelper fh = new ChangeHope.Common.FileHelper();
                                    fh.DeleteFile(Server.MapPath("~\\" + ViewState["Images"].ToString()));
                                }
                                flash_path = uf_falsh.FilePath;
                            }
                            else
                            {

                                this.ltlMsg.Text = "操作失败," + uf_falsh.Message + "";
                                this.pnlMsg.Visible = true;
                                this.pnlMsg.CssClass = "actionErr";
                                return;
                            }
                        }
                        else
                        {
                            this.ltlMsg.Text = "操作失败," + uf_falsh.Message + "";
                            this.pnlMsg.Visible = true;
                            this.pnlMsg.CssClass = "actionErr";
                            return;
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(adId) && ViewState["Images"] != null)
                        {
                            flash_path = ViewState["Images"].ToString();
                        }
                    }
                    model.SizeBreadth = this.txt_flash_Width.Text.Trim();
                    model.Hight = this.txt_flash_Height.Text.Trim();
                    model.LinkAddress = "";
                    model.Hint = "";
                    model.BackgorTarget = Convert.ToInt32(this.rlistTarget2.SelectedValue);
                    model.Advertisecont = "";
                    model.UpspreadAdd = flash_path;
                    model.Adtype = 1;
                    if (string.IsNullOrEmpty(adId))
                    {
                        if (bll.Add(model) > 0)
                        {
                            ChangeHope.WebPage.BasePage.PageRight("动画广告已保存。", "advertise_info_edit.aspx");
                        }
                    }
                    else
                    {
                        model.ID = Convert.ToInt32(adId);
                        bll.Amend(model);
                        ChangeHope.WebPage.BasePage.PageRight("动画广告修改成功。", "advertise_list.aspx");
                    }
                    break;
                case "2"://文本
                    model.Name = this.txt_text_Add_Name.Text.Trim();
                    model.Power = this.txt_text_Power.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_text_Power.Text.Trim());
                    model.BrowseCount = this.txt_text_BrowseCount.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_text_BrowseCount.Text.Trim());
                    model.ClickCount = this.txt_text_ClickCount.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_text_ClickCount.Text.Trim());
                    model.OverdueTime = Convert.ToDateTime(this.dpStart_text.Text.Trim());
                    model.Examine = this.chx_text_Examine.Checked ? 1 : 0;
                    model.StatClick = this.chx_text_ClickCount.Checked ? 1 : 0;
                    model.StatBrowse = this.chx_text_BorwsCount.Checked ? 1 : 0;
                    model.LinkAddress = "";
                    model.Hint = "";
                    model.SizeBreadth = "";
                    model.Hight = "";
                    model.BackgorTarget = 0;
                    model.UpspreadAdd = "";
                    model.Adtype = 2;
                    model.Advertisecont = this.txtContent3.Text.Trim();
                    if (string.IsNullOrEmpty(adId))
                    {
                        if (bll.Add(model) > 0)
                        {
                            ChangeHope.WebPage.BasePage.PageRight("文本广告已保存。", "advertise_info_edit.aspx");
                        }
                    }
                    else
                    {
                        model.ID = Convert.ToInt32(adId);
                        bll.Amend(model);
                        ChangeHope.WebPage.BasePage.PageRight("文本广告修改成功。", "advertise_list.aspx");
                    }
                    break;
                case "3"://幻灯片
                    model.Name = this.txt_Slide_Add_Name.Text.Trim();
                    model.Power = this.txt_Slide_Power.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_Slide_Power.Text.Trim());
                    model.BrowseCount = this.txt_Slide_BrowseCount.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_Slide_BrowseCount.Text.Trim());
                    model.ClickCount = this.txt_Slide_ClickCount.Text.Trim() == "" ? 0 : Convert.ToInt32(this.txt_Slide_ClickCount.Text.Trim());
                    model.OverdueTime = Convert.ToDateTime(this.dpStart_Slide.Text.Trim());
                    model.Examine = this.chx_Slide_Examine.Checked ? 1 : 0;
                    model.StatClick = this.chx_Slide_ClickCount.Checked ? 1 : 0;
                    model.StatBrowse = this.chx_Slide_BorwsCount.Checked ? 1 : 0;

                    model.SizeBreadth = this.txt_Slide_Width.Text.Trim();
                    model.Hight = this.txt_Slide_Height.Text.Trim();
                    model.LinkAddress = this.txtLinkAddress4.Text.Trim();
                    model.Hint = this.txtHint4.Text.Trim();
                    model.BackgorTarget = Convert.ToInt32(this.rlistTarget4.SelectedValue);
                    model.Advertisecont = this.txtContent4.Text.Trim();
                    System.Web.HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;
                    string slide_path = "";
                    string slide_error_info = "";
                    if (files.Count > 1)//说明图片大小和格式都没问题
                    {
                        ChangeHope.Common.UploadFile slide_uf = new ChangeHope.Common.UploadFile();
                        slide_uf.ExtensionLim = ".gif,.jpg,.jpeg,.dmp";
                        slide_uf.FileLengthLim = sp.ImageSize;
                        for (int i = 2; i < files.Count; i++)
                        {
                            slide_uf.MyFile = files[i];
                            slide_uf.SavePath = "/yxuploadfile/accessories/advertise";
                            if (slide_uf.HTMLUpLoad())
                            {
                                if (slide_uf.HaveLoad)
                                {
                                    if (slide_path == "")
                                    {

                                        slide_path = slide_uf.FilePath;
                                    }
                                    else
                                    {
                                        slide_path += "|" + slide_uf.FilePath;
                                    }
                                }
                                else
                                {
                                    slide_error_info += slide_uf.Message + "</br>";
                                    break;
                                }
                            }
                            else
                            {
                                slide_error_info += slide_uf.Message + "</br>";
                                break;
                            }
                        }
                        if (!string.IsNullOrEmpty(adId) && ChangeHope.WebPage.PageRequest.GetFormString("hfImagesAddress") != "")
                        {
                            slide_path += "|" + ChangeHope.WebPage.PageRequest.GetFormString("hfImagesAddress");
                        }
                        if (slide_error_info != "")
                        {
                            this.ltlMsg.Text = "操作失败," + slide_error_info + "";
                            this.pnlMsg.Visible = true;
                            this.pnlMsg.CssClass = "actionErr";
                            return;
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(adId) && ChangeHope.WebPage.PageRequest.GetFormString("hfImagesAddress") != "")
                        {
                            slide_path = ChangeHope.WebPage.PageRequest.GetFormString("hfImagesAddress");
                        }
                    }

                    model.UpspreadAdd = slide_path;
                    model.Adtype = 3;
                    if (string.IsNullOrEmpty(adId))
                    {
                        if (bll.Add(model) > 0)
                        {
                            ChangeHope.WebPage.BasePage.PageRight("幻灯片广告已保存。", "advertise_info_edit.aspx");
                        }
                    }
                    else
                    {
                        model.ID = Convert.ToInt32(adId);
                        bll.Amend(model);
                        ChangeHope.WebPage.BasePage.PageRight("幻灯片广告修改成功。", "advertise_list.aspx");
                    }
                    this.ltlMsg.Text = "操作成功,已保存该信息";
                    this.pnlMsg.Visible = true;
                    this.pnlMsg.CssClass = "actionOk";
                    break;
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 保存信息
        /// </summary>
        protected void Save()
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            ShowShop.BLL.Product.ProductBrand bll = new ShowShop.BLL.Product.ProductBrand();
            ShowShop.Model.Product.ProductBrand model = new ShowShop.Model.Product.ProductBrand();

            model.Name = txtName.Text.Trim();
            if (string.IsNullOrEmpty(txtSort.Text.Trim()))
            {
                model.Sort = 0;
            }
            else
            {
                model.Sort = Convert.ToInt32(txtSort.Text.Trim());
            }
            if (ViewState["ID"] != null)
            {
                model.ID = int.Parse(ViewState["ID"].ToString());
                bll.Update(model);
                ChangeHope.WebPage.BasePage.PageRight("信息已修改。", "productbrand_list.aspx");
            }
            else
            {
                int bId = bll.Add(model);
                if (bId > 0)
                {
                    ChangeHope.WebPage.BasePage.PageRight("信息已保存,您还可以继续添加。", "productbrand_edit.aspx");
                }
            }
        }
Ejemplo n.º 21
0
 /// <summary>
 /// 验证
 /// </summary>
 private void InitWebControl()
 {
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     ChangeHope.WebPage.WebControl.Validate(this.txtName, "输入商品名称的名称,您可以对商品进行品牌归类", "isnull", "必填", "该项为必填项");
     ChangeHope.WebPage.WebControl.Validate(this.txtSort, "输入数字将作为显示的排列顺序", "isint", "必填", "该项为必填项");
     this.Form.Attributes.Add("onsubmit", "return CheckForm()");
 }
Ejemplo n.º 22
0
        private void SpecificationsProduct(string Name, string Value)
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            Regex vaRegex = new Regex(@"\r\n");
            string[] sv =vaRegex.Split(Value);
            StringBuilder shtml = new StringBuilder();
            shtml.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
            shtml.Append("<tr height=\"24px\" bgcolor=\"#FFFFFF\">");
            shtml.Append("<td>&nbsp;&nbsp;<span style=\"font-weight:bold;font-size:14px;\">规格</span>");
            shtml.Append("<input type=\"hidden\" name=\"SpeGroupCount\" id=\"SpeGroupCount\" value=\"1\" />");
            shtml.Append("<input type=\"hidden\" name=\"SpecificationRows\" id=\"SpecificationRows\" value=\"" + sv.Length+ "\" />");
            shtml.Append("</td>");
            shtml.Append("</tr>");
            shtml.Append("<tr bgcolor=\"#EBEDE8\" height=\"22px\">");
            shtml.Append("<td>&nbsp;&nbsp;<a href=\"javascript:showPath('AddSpecifications',document.getElementById('SpecificationsAddress'),'开启规格',650,250,'" + sp.DummyPaht + "');\">添加规格</a>  <a href='javascript:CloseSpecifications();'>关闭规格</a></td>");
            shtml.Append("</tr>");
            shtml.Append("<tr>");
            shtml.Append("<td bgcolor=\"#BAC9C6\" height='2px'>");
            shtml.Append("</td>");
            shtml.Append("</tr>");
            shtml.Append("<tr>");
            shtml.Append("<td>");
            shtml.Append("<span id=\"SpecificationsContent\">");
            shtml.Append("<table id=\"SpecificationTable\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
            shtml.Append("<tr bgcolor=\"#F5F5F5\" height=\"22px\">");
            shtml.Append("<td style=\"font-weight:bold; text-align:center; width:156px\">货号</td>");
            shtml.Append("<span id=\"SpeTitle\">");
            shtml.Append("<td style=\"font-weight:bold; text-align:center;\" >");
            shtml.Append("<input type=\"hidden\" name=\"SpecificationsName1\" id=\"SpecificationsName1\" value=\"" + Name + "\" />");
            shtml.Append("<input type=\"hidden\" name=\"SpecificationsValue1\" id=\"SpecificationsValue1\" value=\"" + Value + "\" />");
            shtml.Append("" + Name + "");
            shtml.Append("</td>");
            shtml.Append("</span>");
            shtml.Append("<td style=\"font-weight:bold;\">库存</td>");
            shtml.Append("<td style=\"font-weight:bold;\">积分</td>");
            shtml.Append("<td style=\"font-weight:bold;\">价格</td>");
            shtml.Append("<td>操作</td>");
            shtml.Append("</tr>");
            for (int i = 0; i < sv.Length; i++)
            {
                shtml.Append("<tr id=\"trSpeRows" + i + "\">");
                shtml.Append("<td>");
                shtml.Append("<input type=\"hidden\" name=\"SpeValRows" + i + "\" id=\"SpeValRows" + i + "\" value=\"" + i + "\"/>");
                shtml.Append("<span id=\"spanSpeValue" + i + "\"><input type=\"hidden\" name=\"SpeValue" + i + "\" id=\"SpeValue" + i + "\" value=\"" + sv[i].Replace("\r", "") + "\"/></span>");
                shtml.Append("<input type=\"text\" name=\"SpeItemNo" + i + "\" id=\"SpeItemNo" + i + "\" />");
                shtml.Append("</td>");
                shtml.Append("<span id=\"SpeValueGroup" + i + "\">");
                shtml.Append("<td style=\"text-align:center;\">" + sv[i].Replace("\r", "") + "</td>");
                shtml.Append("</span>");
                shtml.Append("<td><input type=\"text\" class=\"short_input\" name=\"SpeStock" + i + "\" id=\"SpeStock" + i + "\" /></td>");
                shtml.Append("<td><input type=\"text\" class=\"short_input\" name=\"SpeIntegral" + i + "\" id=\"SpeIntegral" + i + "\" /></td>");
                shtml.Append("<td>");
                shtml.Append("<input type=\"text\" class=\"short_input\" name=\"SpeShopPrice" + i + "\" id=\"SpeShopPrice" + i + "\" />");
                shtml.Append("<input type=\"hidden\" class=\"short_input\" name=\"SpeMemberPrice" + i + "\" id=\"SpeMemberPrice" + i + "\" />");
                shtml.Append("</td>");
                shtml.Append("<td><a href=\"javascript:showPath('SetMemberPrice',document.getElementById('SpecificationsAddress'),'设置会员价',650,250,'" + sp.DummyPaht + "','SpeShopPrice" + i + ";SpeMemberPrice" + i + "');\">会员价</a> <a href='javascript:DelSpecificationRow(" + i + ")'>删除</a></td>");
                shtml.Append("</tr>");
            }
            shtml.Append("</table>");
            shtml.Append("</span>");
            shtml.Append("</td>");
            shtml.Append("</tr>");
            shtml.Append("</table>");

            Response.Write(shtml.ToString());
        }
Ejemplo n.º 23
0
 /// <summary>
 /// 验证
 /// </summary>
 private void InitWebControl()
 {
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     this.txtProduct.Attributes.Add("readonly", "readonly");
     this.txtProduct.Attributes.Add("onclick", "selectFile('OrderCardProduct',new Array(" + this.hfid.ClientID + "," + this.txtProduct.ClientID + "),310,450,'" + sp.DummyPaht + "');");
     ChangeHope.WebPage.WebControl.SetDate(this.txtEndTime);
     ChangeHope.WebPage.WebControl.Validate(this.txtFaceValue, "输入点卡面值", "isfloat", "必填", "该项为必填项");
     ChangeHope.WebPage.WebControl.Validate(this.txtEndTime, "输入截止日期", "isnull", "必填", "该项为必填项");
     ChangeHope.WebPage.WebControl.Validate(this.txtPrice, "输入出售的价格", "ifisfloat", "选填", "该项为选填项,必须为数字和带小数。");
     this.Form.Attributes.Add("onsubmit", "return CheckForm()");
 }
Ejemplo n.º 24
0
 private void InitWebControl()
 {
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     //this.txtArea.Attributes.Add("readonly", "readonly");
     // this.txtArea.Attributes.Add("onclick", "selectFile('Area',new Array(" + this.w_l_pro_Area.ClientID + "," + this.txtArea.ClientID + "),310,450,'" + sp.DummyPaht + "');");
     this.txtProductClass.Attributes.Add("readonly", "readonly");
     this.txtProductClass.Attributes.Add("onclick", "selectFile('Productclass',new Array(" + this.w_d_pro_CID.ClientID + "," + this.txtProductClass.ClientID + "),310,450,'" + sp.DummyPaht + "');");
     //this.txtUserName.Attributes.Add("readonly", "readonly");
     //this.txtUserName.Attributes.Add("onclick", "selectFile('Memberlist',new Array(" + this.w_d_pro_PutoutID.ClientID + "," + this.txtUserName.ClientID + "),310,450,'" + sp.DummyPaht + "');");
 }
Ejemplo n.º 25
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ShowShop.Common.SysParameter ss = new ShowShop.Common.SysParameter();
         BindData();
     }
 }
        /// <summary>
        /// 上传商品相册图
        /// </summary>
        /// <param name="albumthumbnail"></param>
        /// <param name="ImagesThumbnailsWidth"></param>
        /// <param name="ImagesThumbnailsHeight"></param>
        /// <param name="WhetherWater"></param>
        /// <param name="ImageWatermarkTransparent"></param>
        /// <param name="TextWatermarkTransparent"></param>
        /// <param name="WatermarkPosition"></param>
        /// <param name="WatermarkImage"></param>
        /// <param name="WatermarkText"></param>
        /// <param name="TextOrImagesWatermark"></param>
        protected string Album(int ImagesThumbnailsWidth, int ImagesThumbnailsHeight, bool WhetherWater, int ImageWatermarkTransparent, int TextWatermarkTransparent, string WatermarkPosition, string WatermarkImage, string WatermarkText, string TextOrImagesWatermark, bool IsModfiy, int SignId)
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            string gomessage = "";
            ShowShop.BLL.Product.ProductInfo bll = new ShowShop.BLL.Product.ProductInfo();
            System.Web.HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;
            ShowShop.BLL.Product.ProductAlbum pabll = new ShowShop.BLL.Product.ProductAlbum();
            ShowShop.Model.Product.ProductAlbum pamodel = new ShowShop.Model.Product.ProductAlbum();
            string[] rd = null;
            string des = ChangeHope.WebPage.PageRequest.GetFormString("description");
            if (!string.IsNullOrEmpty(des))
            {
                rd = des.Split(',');//获得图片描述的文本框字符串数组,为对应的图片的描述
            }
            if (files.Count > 1)//说明图片大小和格式都没问题
            {
                ShowShop.BLL.Product.ProductAlbum PGBLL = new ShowShop.BLL.Product.ProductAlbum();
                ShowShop.Model.Product.ProductAlbum PGModel = new ShowShop.Model.Product.ProductAlbum();
                int autouFile=files.Count;
                ChangeHope.Common.UploadProcesedImages wm = new ChangeHope.Common.UploadProcesedImages();
                ChangeHope.Common.UploadFile uf = new ChangeHope.Common.UploadFile();
                string AlbumThumbnailSave = "/yxuploadfile/product/albumthumbnail";
                string AlbumOriginalSave = "/yxuploadfile/product/albumoriginal";
                string AlbumThumbnail = string.Empty;
                string AlbumOriginal = string.Empty;
                string Message = string.Empty;
                uf.ExtensionLim = ".gif,.jpg,.jpeg,.bmp";
                uf.FileLengthLim = sp.ImageSize;
                for (int i = 1; i < files.Count; i++)
                {
                    uf.MyFile = files[i];
                    uf.SavePath = AlbumOriginalSave;
                    if (uf.HTMLUpLoad())
                    {
                        if (uf.HaveLoad)
                        {
                            AlbumOriginal = uf.FilePath;
                            //原图缩略图
                            wm.SourceImagePath = AlbumOriginal;
                            wm.ThumbnailImagePath = AlbumOriginalSave;
                            wm.ThumbnailImageWidth = ImagesThumbnailsWidth;
                            wm.ThumbnailImageHeight = ImagesThumbnailsHeight;
                            if (wm.ToThumbnailImage())
                            {
                                AlbumThumbnail = wm.FilePath;
                            }
                            else
                            {
                                gomessage += "<br>" + wm.Message;

                            }
                        }
                        else
                        {
                            gomessage += "<br>" + uf.Message;
                        }
                        if (WhetherWater)
                        {
                            //原图水印
                            if (!string.IsNullOrEmpty(AlbumOriginal))
                            {
                                wm.SourceImagePath = AlbumOriginal;
                                wm.ImageDeaphaneity = float.Parse(ImageWatermarkTransparent.ToString());
                                wm.Diaphaneity = TextWatermarkTransparent;
                                switch (WatermarkPosition)
                                {
                                    case "1":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.LeftTop;
                                        break;
                                    case "2":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.LeftBottom;
                                        break;
                                    case "3":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.RightTop;
                                        break;
                                    case "4":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.RightBottom;
                                        break;
                                    case "5":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.CenterTop;
                                        break;
                                    case "9":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.Center;
                                        break;
                                    case "7":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.CenterBottom;
                                        break;
                                }
                                if (TextOrImagesWatermark == "0")
                                {
                                    //图片水印
                                    if (!string.IsNullOrEmpty(WatermarkImage))
                                    {
                                        wm.WaterMarkImagePath = WatermarkImage;
                                    }
                                    else
                                    {
                                        gomessage += "<br>" + "操作失败,上传图片水印失败,请确认系统设置水印图片是否存在。";
                                    }
                                }
                                else
                                {
                                    //文字水印
                                    if (!string.IsNullOrEmpty(WatermarkText))
                                    {
                                        wm.WaterMarkText = WatermarkText;
                                    }
                                    else
                                    {
                                        gomessage += "<br>" + "操作失败,上传图片水印失败,请确认系统设置水印文字是否存在。";
                                    }
                                }
                                wm.SaveWaterMarkImagePath = AlbumOriginalSave;
                                if (wm.ToWaterMark())
                                {
                                    AlbumOriginal = wm.FilePath;
                                }
                                else
                                {
                                    gomessage += "<br>" + "操作失败," + wm.Message + "";
                                }
                            }
                            //原图缩略图水印
                            if (!string.IsNullOrEmpty(AlbumThumbnail))
                            {
                                wm.SourceImagePath = AlbumThumbnail;
                                wm.ImageDeaphaneity = float.Parse(ImageWatermarkTransparent.ToString());
                                wm.Diaphaneity = TextWatermarkTransparent;
                                switch (WatermarkPosition)
                                {
                                    case "1":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.LeftTop;
                                        break;
                                    case "2":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.LeftBottom;
                                        break;
                                    case "3":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.RightTop;
                                        break;
                                    case "4":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.RightBottom;
                                        break;
                                    case "5":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.CenterTop;
                                        break;
                                    case "9":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.Center;
                                        break;
                                    case "7":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.CenterBottom;
                                        break;
                                }
                                if (TextOrImagesWatermark == "0")
                                {
                                    //图片水印
                                    if (!string.IsNullOrEmpty(WatermarkImage))
                                    {
                                        wm.WaterMarkImagePath = WatermarkImage;
                                    }
                                    else
                                    {
                                        gomessage += "<br>" + "操作失败,上传图片水印失败,请确认系统设置水印图片是否存在。";
                                    }
                                }
                                else
                                {
                                    //文字水印
                                    if (!string.IsNullOrEmpty(WatermarkText))
                                    {
                                        wm.WaterMarkText = WatermarkText;
                                    }
                                    else
                                    {
                                        gomessage += "<br>" + "操作失败,上传图片水印失败,请确认系统设置水印文字是否存在。";
                                    }
                                }
                                wm.SaveWaterMarkImagePath = AlbumThumbnailSave;
                                if (wm.ToWaterMark())
                                {
                                    AlbumThumbnail = wm.FilePath;
                                }
                                else
                                {
                                    gomessage += "<br>" + "操作失败," + wm.Message + "";
                                }
                            }

                        }
                    }
                    pamodel.Productid = 0;
                    pamodel.OriginalAddress = AlbumOriginal;
                    pamodel.ThumbnailAddress = AlbumThumbnail;
                    pamodel.IsSpecialspecificationsSign = 1;
                    pamodel.SpecificaticationSignId = SignId;
                    pamodel.Description = "";
                    if (AlbumThumbnail != string.Empty)
                    {
                        pabll.Add(pamodel);
                    }
                }

            }
            return gomessage;
        }
 private string BindPhoto(int id)
 {
     StringBuilder shtml = new StringBuilder();
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     ShowShop.BLL.Product.ProductAlbum bll = new ShowShop.BLL.Product.ProductAlbum();
     DataTable dts = bll.GetProAlbumAll(0, id, 1);
     StringBuilder str = new StringBuilder();
     int j = 1;
     shtml.Append("<table border='0'>");
     shtml.Append("<tr>");
     for (int i = 0; i < dts.Rows.Count; i++)
     {
         shtml.Append("<td align='center'><img width=\"100px\" height=\"100px\" src=\"" + sp.DummyPaht + dts.Rows[i]["originaladdress"].ToString() + "\"/><br/><br/><span onclick=\"DelProAlbum(" + dts.Rows[i]["id"].ToString() + ");\"  style=\"cursor:hand;width:45px\" >删除</span></td>");
         if (j % 6 == 0)
         {
             shtml.Append("</tr><tr>");
         }
         j++;
     }
     shtml.Append("</tr></table>");
     return shtml.ToString();
 }
 private void BindInfo(int ProductID,int SpecificaticationSignId,int IsSpecialspecificationsSign)
 {
     ShowShop.BLL.Product.ProductAlbum bll = new ShowShop.BLL.Product.ProductAlbum();
     DataTable dt = bll.GetProAlbumAll(ProductID, SpecificaticationSignId, IsSpecialspecificationsSign);
     if (dt.Rows.Count > 0)
     {
         if (dt.Rows[0]["OriginalAddress"].ToString().Contains("#"))
         {
             this.TitleColor.Value = dt.Rows[0]["OriginalAddress"].ToString().Replace("#", "");
             this.rblSpecSign.SelectedValue = "1";
             this.ColorSign.Style.Value = "display:";
             this.ColorAddressImages.Style.Value = "display:none";
             Color = dt.Rows[0]["OriginalAddress"].ToString().Replace("#", "");
         }
         else
         {
             ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
             this.SignImages.Text = "<img width='20px' alt='上传的图标' height='20px' src='" +sp.DummyPaht+ dt.Rows[0]["OriginalAddress"].ToString() + "'>";
             this.rblSpecSign.SelectedValue = "2";
             this.ColorSign.Style.Value = "display:none";
             this.ColorAddressImages.Style.Value = "display:";
             ViewState["ColorSignImages"] = dt.Rows[0]["OriginalAddress"].ToString();
         }
         ViewState["ID"] = dt.Rows[0]["id"].ToString();
         this.litaAlbum.Text =this.BindPhoto(Convert.ToInt32(dt.Rows[0]["id"].ToString()));
     }
 }
        protected void button2_Click(object sender, EventArgs e)
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            bool WhetherWater = sp.IsWatermark;
            string ThumbnailSavePath = "/yxuploadfile/product/thumbnail";
            int ThumbnailsHeight = sp.ThumbnailsHeight;
            int ThumbnailsWidth = sp.ThumbnailsWidth;
            int ImagesThumbnailsHeight = sp.ImagesThumbnailsHeight;
            int ImagesThumbnailsWidth = sp.ImagesThumbnailsWidth;
            int TextWatermarkTransparent = sp.TextWatermarkTransparent;
            int ImageWatermarkTransparent = sp.ImageWatermarkTransparent;
            string TextOrImagesWatermark = sp.TextOrImagesWatermark;
            string WatermarkText = sp.WatermarkText;
            string WatermarkImage = sp.WatermarkImage;
            string WatermarkPosition = sp.WatermarkPosition;
            string Original = string.Empty;
            string OriginalThumbnails = string.Empty;
            string ThumbnailsImage = string.Empty;

            int productId = ChangeHope.WebPage.PageRequest.GetQueryInt("productId");
            int specificationId = ChangeHope.WebPage.PageRequest.GetQueryInt("id");
            string colorSign = "";
            if (this.rblSpecSign.SelectedValue == "2")
            {
                if (this.fuColorSign.PostedFile.ContentLength > 2)
                {
                    ChangeHope.Common.UploadFile uf = new ChangeHope.Common.UploadFile();
                    uf.ExtensionLim = ".gif,.jpg,.jpeg,.bmp";
                    uf.FileLengthLim = sp.ImageSize;
                    uf.PostedFile = this.fuColorSign;
                    uf.SavePath = ThumbnailSavePath;

                    if (uf.Upload())
                    {
                        if (uf.HaveLoad)
                        {
                            colorSign = uf.FilePath;
                        }
                    }
                    else
                    {
                        this.ltlMsg.Text = "操作失败," + uf.Message + "";
                        this.pnlMsg.Visible = true;
                        this.pnlMsg.CssClass = "actionOk";
                        return;
                    }
                }
                else
                {
                    if (ViewState["ID"] != null && ViewState["ColorSignImages"] != null)
                    {
                        colorSign = ViewState["ColorSignImages"].ToString();
                    }
                }
            }
            else
            {
                colorSign="#"+this.TitleColor.Value;
            }

            ShowShop.BLL.Product.ProductAlbum bll = new ShowShop.BLL.Product.ProductAlbum();
            ShowShop.Model.Product.ProductAlbum model = new ShowShop.Model.Product.ProductAlbum();
            model.Productid = productId;
            model.OriginalAddress = colorSign;
            model.IsSpecialspecificationsSign = 1;
            model.SpecificaticationSignId=specificationId;
            model.ThumbnailAddress = "";
            model.Description = "";
            int signId = 0;
            if (ViewState["ID"] != null)
            {
                model.ID = Convert.ToInt32(ViewState["ID"]);
                bll.Update(model);
                signId = Convert.ToInt32(ViewState["ID"]);
            }
            else
            {
                signId = bll.Add(model);
            }
            if (signId > 0)
            {
                string AlbumInfo = Album(ImagesThumbnailsWidth, ImagesThumbnailsHeight, WhetherWater, ImageWatermarkTransparent, TextWatermarkTransparent, WatermarkPosition, WatermarkImage, WatermarkText, TextOrImagesWatermark, true, signId);

                    ChangeHope.WebPage.BasePage.PageRight("操作成功。", "product_specialspecification_list.aspx?id=" + productId + "&putoutType=0");
            }
        }
Ejemplo n.º 30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if(!this.Page.IsPostBack)
        {
        ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
        WebName = sp.WebSiteName;
        }
 }