예제 #1
0
        public static int Add(PhotoAlbumInfo entity)
        {
            int result;

            if (entity == null)
            {
                result = 0;
            }
            else
            {
                result = BizBase.dbo.InsertModel <PhotoAlbumInfo>(entity);
            }
            return(result);
        }
예제 #2
0
 public static bool Update(PhotoAlbumInfo entity)
 {
     return(entity != null && BizBase.dbo.UpdateModel <PhotoAlbumInfo>(entity));
 }
예제 #3
0
        private void SetEntity(ProductInfo pro, System.Collections.Generic.List <PhotoAlbumInfo> listProPhoto)
        {
            int brandID        = WebUtils.StringToInt(this.DropDownList3.SelectedValue, 0);
            int areaModelID    = WebUtils.StringToInt(this.ddlAreaModel.SelectedValue, 0);
            int postageModelID = WebUtils.StringToInt(this.ddlPostageModel.SelectedValue, 0);

            pro.BrandID        = brandID;
            pro.ModelID        = this.currCate.ModelID;
            pro.SellType       = this.RadioButtonList8.SelectedItem.Text;
            pro.ProductSN      = WebUtils.GetString(this.TextBox4.Text);
            pro.ProImg         = this.TextBox5.Text;
            pro.Stock          = WebUtils.StringToInt(this.TextBox15.Text, 0);
            pro.AlarmNum       = WebUtils.GetInt(this.alartnum.Text);
            pro.MarketPrice    = WebUtils.StringToDecimal(this.TextBox10.Text, 0m);
            pro.SellPrice      = WebUtils.StringToDecimal(this.TextBox11.Text, 0m);
            pro.Unit           = WebUtils.GetString(this.TextBox12.Text);
            pro.BuyIntegral    = WebUtils.StringToInt(this.TextBox13.Text, 0);
            pro.GiveIntegral   = WebUtils.StringToInt(this.TextBox14.Text, 0);
            pro.BuyLimit       = WebUtils.StringToInt(this.TextBox16.Text, 0);
            pro.SEOKey         = WebUtils.GetString(this.metaKey.Text);
            pro.SEODescription = WebUtils.GetString(this.metaDescription.Text);
            pro.IsTop          = this.chkHot.Checked;
            pro.IsRecommend    = this.chkRecommand.Checked;
            pro.IsNew          = this.chkNew.Checked;
            pro.Status         = (this.auditstatus.Checked ? 99 : 0);
            pro.IsExchange     = this.chkExchange.Checked;
            pro.IsVirtual      = this.isvirtual.Checked;
            pro.IsBooking      = this.isbooking.Checked;
            pro.ProIDs         = this.SetSuitPros();
            pro.AreaModelID    = areaModelID;
            pro.PostageModelID = postageModelID;
            pro.ClassID        = ((this.goodsClass == null) ? 0 : this.goodsClass.AutoID);
            pro.Tags           = WebUtils.GetFormString("chk_tag");
            string formString = WebUtils.GetFormString("hdf_memberprice");

            if (!string.IsNullOrEmpty(formString))
            {
                pro.MemberPriceSet = formString.Replace("逗号", ",");
            }
            string formString2 = WebUtils.GetFormString("proimg");
            string formString3 = WebUtils.GetFormString("imgdesc");

            string[] array = formString2.Split(new char[]
            {
                ','
            });
            string[] array2 = formString3.Split(new char[]
            {
                ','
            });
            if (array.Length > 0)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    string text = array[i].Trim();
                    if (!string.IsNullOrEmpty(text))
                    {
                        PhotoAlbumInfo photoAlbumInfo = new PhotoAlbumInfo();
                        photoAlbumInfo.ImgSrc      = text;
                        photoAlbumInfo.ImgThumbSrc = photoAlbumInfo.ImgSrc.Replace(System.IO.Path.GetExtension(text), "_thumb" + System.IO.Path.GetExtension(text));
                        photoAlbumInfo.Remark      = array2[i];
                        listProPhoto.Add(photoAlbumInfo);
                    }
                }
            }
        }