示例#1
0
        protected void dplThirdClum_SelectedIndexChanged(object sender, EventArgs e)
        {
            ThirdClassDm third = new ThirdClassDm();

            third.ThirdClassDmName = dplThirdClum.SelectedItem.Text;
            GA gAdmin = new GA();

            third.ThirdClassDmID = gAdmin.TcNameGetID(third);
            PropertyClassDm propertyclass = new PropertyClassDm();
            List <Property> prolist       = new List <Property>();

            prolist = PropertyClassDm.TcIDGetPoID(third);
            DataList1.DataSource = Property.PoIDGetPoNameList(prolist);
            DataList1.DataBind();
            for (int i = 0; i < prolist.Count; i++)
            {
                PropertyContent proCont = new PropertyContent();
                proCont.PropertyID = prolist[i].PropertyID;
                List <PropertyContent> proConList = new List <PropertyContent>();
                proConList = PropertyContent.PoIDGetPcName(proCont);
                DropDownList ddl = (DropDownList)DataList1.Items[i].FindControl("dpl_PropertyContent");
                for (int j = 0; j < proConList.Count; j++)
                {
                    ddl.Items.Add(new ListItem(proConList[j].PropertyContentName, j.ToString()));
                }
                ddl.Items.Insert(0, new ListItem("选择属性内容"));
                ddl.DataBind();
            }
            this.lbl_tip.Text = "";
        }
示例#2
0
        private static IEnumerable <EntityContent> GetMapObjects(TiledObjectGroup layer)
        {
            var result = new List <EntityContent>();

            foreach (var obj in layer.Objects)
            {
                if (string.IsNullOrWhiteSpace(obj.Type))
                {
                    throw new InvalidOperationException("Found object without type!");
                }
                if (string.IsNullOrWhiteSpace(obj.Name))
                {
                    throw new InvalidOperationException("Found object without name!");
                }

                var content = new EntityContent();
                content.Name     = obj.Name;
                content.Type     = obj.Type;
                content.Position = new Vector2(obj.X, obj.Y);

                foreach (var property in obj.Properties)
                {
                    var objProperty = new PropertyContent();
                    objProperty.Name  = property.Key;
                    objProperty.Value = property.Value;

                    content.Properties.Add(objProperty);
                }

                result.Add(content);
            }
            return(result);
        }
        public MarketPropertyContent GetMarketPropertyContents(string MarketCode)
        {
            var objMarketPropertyContent = new MarketPropertyContent();

            try
            {
                var response = ServiceBridge <string, List <Model.ServiceModel.MarketPropertyContentResponse.MarketPropertyContentResponse> > .Run(MarketCode, ServiceTypes.MarketPropertyContentSearch, HttpMethod.Get);

                objMarketPropertyContent.PropertyContents = new List <PropertyContent>();
                PropertyContent objPropertyContent;
                if (response != null)
                {
                    var objProperties = response.FirstOrDefault();

                    foreach (var item in response)
                    {
                        objPropertyContent              = new PropertyContent();
                        objPropertyContent.Market       = item.marketCode;
                        objPropertyContent.PropertyCode = item.property;
                        objPropertyContent.PropertyName = item.propertyName;
                        objPropertyContent.Summary      = item.summary;
                        objPropertyContent.ImageUrl     = item.thumbnail.url;

                        objMarketPropertyContent.PropertyContents.Add(objPropertyContent);
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(objMarketPropertyContent);
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            GA           gAdmin = new GA();
            GAController gadmin = new GAController();
            Property     pro    = new Property();

            pro.PropertyName = drpNewProname.SelectedItem.Text;
            List <PropertyContent> proconlist = new List <PropertyContent>();
            PropertyContent        content    = new PropertyContent();
            string a = gAdmin.PoNameGetID(pro);

            content.PropertyID = a;
            proconlist         = PropertyContent.PoIDGetPcName(content);
            if (proconlist.Count == 0)
            {
                if (gadmin.DeletePrperty(gAdmin, a))
                {
                    this.lblCheck.Text = "删除成功!";
                    //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "删除成功" + "');</script>");
                }
                else
                {
                    this.lblCheck.Text = "删除失败!";
                    //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "删除失败" + "');</script>");
                }
            }
            else
            {
                this.lblCheck.Text = "该属性下有内容!";
                //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "该属性下有内容" + "');</script>");
            }
        }
 protected void btnAdd1_Click(object sender, EventArgs e)
 {
     if (tbxNewcon.Text != "")
     {
         GA gAdmin = new GA();
         PropertyContent procontent = new PropertyContent();
         Property        property   = new Property();
         property.PropertyName          = drpNewProname.SelectedItem.Text;
         procontent.PropertyID          = gAdmin.PoNameGetID(property);
         procontent.PropertyContentName = tbxNewcon.Text;
         if (PropertyContent.PcIsRepeat(procontent) == true)//不重复
         {
             if (gAdmin.AddPoContent(procontent) == true)
             {
                 this.lblCheck.Text = "添加成功!";
                 //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "添加成功" + "');</script>");
             }
             else
             {
                 this.lblCheck.Text = "添加失败!";
                 //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "添加失败" + "');</script>");
             }
         }
         else
         {
             this.lblCheck.Text = "属性关系已经存在!";
             this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "属性关系已经存在" + "');</script>");
         }
     }
     else
     {
         this.lblCheck.Text = "添加不能为空!";
         //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "添加不能为空" + "');</script>");
     }
 }
示例#6
0
        /// <summary>
        /// 将LIST变成DATATABLE
        /// </summary>
        /// <param name="proConList"></param>
        /// <returns></returns>
        private DataTable ListConvertDataTable(List <PropertyContent> proConList)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("PropertyContentName");
            PropertyContent proCont = new PropertyContent();

            if (proConList != null || proConList.Count > 0)
            {
                for (int i = 0; i < proConList.Count; i++)
                {
                    proCont = proConList[i];
                    DataRow dr = dt.NewRow();
                    dr["PropertyContentName"] = proCont.PropertyContentName;
                    dt.Rows.Add(dr);
                }
            }
            return(dt);
        }
        protected void drpNewProname_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListBox2.Items.Clear();
            this.drpNewProcon.Items.Clear();
            Property               property       = new Property();
            PropertyContent        procontent     = new PropertyContent();
            List <PropertyContent> procontentlist = new List <PropertyContent>();
            GA gAdmin = new GA();

            property.PropertyName = this.drpNewProname.SelectedItem.Text;
            procontent.PropertyID = gAdmin.PoNameGetID(property);
            procontentlist        = PropertyContent.PoIDGetPcName(procontent);
            for (int i = 0; i < procontentlist.Count; i++)
            {
                drpNewProcon.Items.Add(new ListItem(procontentlist[i].PropertyContentName, i.ToString()));
                ListBox2.Items.Add(procontentlist[i].PropertyContentName);
            }
            drpNewProcon.Items.Insert(0, new ListItem("请选择属性内容"));
        }
示例#8
0
        public void setPropertyContent(PropertyEditor content)
        {
            if (PropertyContent != null && content.PropertyObject == PropertyContent.PropertyObject)
            {
                PropertyContent.Refresh();
                return;
            }

            if (IsHandleCreated)
            {
                Invoke(new NoArgFunction(() =>
                {
                    setPropertyContentInternal(content);
                }));
            }
            else
            {
                setPropertyContentInternal(content);
            }
        }
        //修改属性内容
        protected void btnUpdate1_Click(object sender, EventArgs e)
        {
            GA gAdmin = new GA();
            PropertyContent proConAlter = new PropertyContent();
            PropertyContent proConNow   = new PropertyContent();

            proConAlter.PropertyContentName = this.tbxCondelup.Text;
            proConNow.PropertyContentName   = this.drpNewProcon.SelectedItem.Text;
            if (proConAlter.SelectProCon() == true)
            {
                if (proConNow.UpdateProCon(proConAlter.PropertyContentName) == true)
                {
                    this.lblCheck.Text = "修改成功!";
                }
                else
                {
                    this.lblCheck.Text = "修改失败!";
                }
            }
            else
            {
                this.lblCheck.Text = "修改内容已存在!修改无效!";
            }
        }
示例#10
0
 protected void btnOK_Click(object sender, EventArgs e)
 {
     if (this.tbxName.Text != "" && this.tbxCount.Text != "" && this.tbxPicexplain.Text != "" && this.tbxPrice.Text != "" && this.tbxPriurl.Text != "")
     {
         GA   gAdmin = new GA();
         Good good   = new Good();//定义对象
         good.GoodName      = this.tbxName.Text;
         good.GoodIncentory = Convert.ToInt32(this.tbxCount.Text);
         good.GoodPrice     = this.tbxPrice.Text;
         FirstClassDm first = new FirstClassDm();
         first.FirstClassDmName = this.dplFirstClum.SelectedItem.Text;
         SecondClassDm second = new SecondClassDm();
         second.SecondClassDmName = this.dplSecondClum.SelectedItem.Text;
         ThirdClassDm Third = new ThirdClassDm();
         Third.ThirdClassDmName = this.dplThirdClum.SelectedItem.Text;
         good.FirstClassDmID    = gAdmin.FcNameGetID(first);//传一、二、三级类目ID
         good.SecondClassDmID   = gAdmin.ScNameGetID(second);
         good.ThirdClassDmID    = gAdmin.TcNameGetID(Third);
         if (gAdmin.AddGood(good) == true)                                        //添加商品表
         {
             for (int GoodCount = 0; GoodCount < good.GoodIncentory; GoodCount++) //添加单个商品
             {
                 SingleGoodInfo singleGoodinfo = new SingleGoodInfo();
                 singleGoodinfo.StaffID = Convert.ToInt32(Session["hStaffID"].ToString());
                 singleGoodinfo.GoodID  = Good.GoodNameGetID(good);
                 gAdmin.AddSingleGoodInfo(singleGoodinfo);
                 SaveSingleGoodInfo saveSinGoodinfo = new SaveSingleGoodInfo();
                 saveSinGoodinfo.StaffID = Convert.ToInt32(Session["hStaffID"].ToString());
                 saveSinGoodinfo.GoodID  = Good.GoodNameGetID(good);
                 gAdmin.AddSaveSingleGoodInfo(saveSinGoodinfo);
             }
             ImgInfo imginfo = new ImgInfo();
             imginfo.GoodID     = Good.GoodNameGetID(good);
             imginfo.ImgAddress = this.tbxPriurl.Text;
             imginfo.ImgTitle   = this.tbxPicexplain.Text;
             if (gAdmin.AddImginfo(imginfo) == true)//添加商品图片信息表
             {
                 GoodPropertyComb goodprocomb = new GoodPropertyComb();
                 ThirdClassDm     third       = new ThirdClassDm();
                 third.ThirdClassDmName = dplThirdClum.SelectedItem.Text;
                 third.ThirdClassDmID   = gAdmin.TcNameGetID(third);
                 PropertyClassDm propertyclass = new PropertyClassDm();
                 List <Property> prolist       = new List <Property>();
                 prolist = PropertyClassDm.TcIDGetPoID(third);
                 int count = 0;
                 for (int i = 0; i < prolist.Count; i++)
                 {
                     PropertyContent proCont = new PropertyContent();
                     goodprocomb.GoodID     = Good.GoodNameGetID(good);
                     goodprocomb.PropertyID = prolist[i].PropertyID;
                     DropDownList ddl = (DropDownList)DataList1.Items[i].FindControl("dpl_PropertyContent"); //在datalist中找dropdownlist
                     goodprocomb.PropertyContent = ddl.SelectedItem.Text;
                     if (gAdmin.AddGoodPropertyComb(goodprocomb))                                            //绑定属性、属性内容、和商品的关系
                     {
                         count += 1;
                     }
                 }
                 if (count == prolist.Count)
                 {
                     this.lblCheck.Text = "添加成功!";
                     //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language=javascript>alert('" + "添加成功" + "'); </script>");
                 }
             }
             else
             {
                 this.lblCheck.Text = "添加失败";
                 //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language=javascript>alert('" + "添加失败" + "'); </script>");
             }
         }
         else
         {
             this.lblCheck.Text = "添加失败!";
             //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language=javascript>alert('" + "添加失败" + "'); </script>");
         }
     }
     else
     {
         this.lblCheck.Text = "添加项不能为空!";
     }
 }