Пример #1
0
        protected void ButtonAddItem_Click(object sender, EventArgs e)
        {
            string category    = Request.QueryString["cat"];
            string name        = String.Format("{0}", Request.Form["ctl00$MainContent$input_name"]);
            string description = String.Format("{0}", Request.Form["ctl00$MainContent$input_text"]);
            string price       = String.Format("{0}", Request.Form["ctl00$MainContent$price_value"]);
            string video       = String.Format("{0}", Request.Form["ctl00$MainContent$input_video"]);
            string place       = String.Format("{0}", Request.Form["ctl00$MainContent$additem_place"]);
            string phone       = String.Format("{0}", Request.Form["ctl00$MainContent$phonenum"]);
            string messageType = String.Format("{0}", Request.Form["ctl00$MainContent$contact"]);

            var objPhotos = Request.Form["AdvertPhotos"];

            Rentoolo.Model.Adverts advert = new Model.Adverts();

            if (objPhotos != null)
            {
                String[] listPhotos = objPhotos.Split(',');

                var jsonPhotos = JsonConvert.SerializeObject(listPhotos);

                advert.ImgUrls = jsonPhotos;
            }
            else
            {
                advert.ImgUrls = "[\"/img/a/noPhoto.png\"]";
            }

            try
            {
                advert.Category = Int32.Parse(category);
            }
            catch { }

            advert.Name = name;

            advert.Description = description;

            try
            {
                advert.Price = double.Parse(price);
            }
            catch { }

            //advert.video = video;

            advert.Address = place;

            advert.Phone = phone;

            advert.YouTubeUrl = video;

            advert.CreatedUserId = User.UserId;

            advert.Created = DateTime.Now;

            AdvertsDataHelper.AddAdvert(advert);

            Response.Redirect("MyAdverts.aspx");
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id       = Request.QueryString["id"];
            string advertId = Request.QueryString["advertId"];

            ItemRequests = DataHelper.GetExchangeItemRequests(Convert.ToInt64(id));

            Advert = AdvertsDataHelper.GetAdvert(Convert.ToInt64(advertId));
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];

            itemRequest = DataHelper.GetExchangeItemRequest(Convert.ToInt64(id));

            ExchangeProducts exchangeItem = DataHelper.GetExchangeItem(itemRequest.ExchangeItemId);

            wantedExchangeItem = DataHelper.GetExchangeItem(itemRequest.WantedExchangeItemId);

            ExchangeAdvert = AdvertsDataHelper.GetAdvert(exchangeItem.AdvertId);
            WantedAdvert   = AdvertsDataHelper.GetAdvert(wantedExchangeItem.AdvertId);
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CategoryId = Request.QueryString["cat"];


            if (string.IsNullOrEmpty(CategoryId))
            {
                Response.Redirect("/Account/Category");
            }

            bool isRedacting = Request.QueryString["redact"] == null ? false : true;

            if (isRedacting)
            {
                long advId = Convert.ToInt64(Request.QueryString["advId"]);
                Advert = AdvertsDataHelper.GetAdvert(advId);
            }


            var a = 5;
            //CategoryName = CategoryHelper.GetCategoryName(CategoryId);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];

            AdvertItem = AdvertsDataHelper.GetAdvert(Convert.ToInt64(id));
        }