Exemplo n.º 1
0
        protected bool GenerateInvoice(int id, SpiceLogic.PayPalCtrlForWPS.Controls.BuyNowButton btnBuy, bool unframe)
        {
            ArtGalleryDS.PictureDataTable table = PictureDL.GetById(id);
            if (table == null || table.Rows.Count != 1)
            {
                return(false);
            }
            ArtGalleryDS.PictureRow row = table[0];
            btnBuy.ItemName   = row.Title + (unframe ? " (unframed)" : "");
            btnBuy.ItemNumber = id.ToString();
            if (!unframe)
            {
                Calculate(btnBuy, row.Width, row.Height, row.Frame, row.weight);
            }
            else
            {
                btnBuy.Height   = (int)Math.Ceiling(Math.Min(row.Width, row.Height));
                btnBuy.Width    = 3;
                btnBuy.Handling = 10;
                btnBuy.Weight   = (decimal)2.0;
                btnBuy.AdditionalDataItems["strongbox"] = "none needed";
            }
            btnBuy.ItemNumber = id.ToString();
            btnBuy.AdditionalDataItems["unframed"] = unframe.ToString().ToLower();
            btnBuy.AdditionalDataItems["width"]    = "0";
            btnBuy.AdditionalDataItems["height"]   = "0";
            btnBuy.Amount = (decimal)row.price;

            return(true);
        }
        protected void btnNext_Click(object sender, ImageClickEventArgs e)
        {
            List <int>  list = (List <int>)Session["search"];
            HiddenField ID   = FormView1.FindControl("ID") as HiddenField;
            int         id   = 0;

            if (int.TryParse(ID.Value, out id))
            {
                int index = list.FindIndex(x => x == id);
                if (index == list.Count - 1)
                {
                    index = 0;
                }
                else
                {
                    index = index + 1;
                }

                id = list[index];
                ArtGalleryDS.PictureDataTable table = PictureDL.GetById(id);
                FormView1.DataSource = table.Rows;
                FormView1.DataBind();

                ArtGalleryDS.Picture_GetWithWaterMarkDataTable table1 = PictureDL.GetWithWaterMark(id);
                FormView2.DataSource = table1.Rows;
                FormView2.DataBind();
                up1.Update();
                up2.Update();
            }
        }
Exemplo n.º 3
0
        private void ProcessPicture(int id)
        {
            ArtGalleryDS.PictureDataTable table = PictureDL.GetById(id);
            FormView1.DataSource = table.Rows;
            FormView1.DataBind();

            ArtGalleryDS.Picture_GetWithWaterMarkDataTable table1 = PictureDL.GetWithWaterMark(id);
            FormView2.DataSource = table1.Rows;
            FormView2.DataBind();
        }