public void UpdateItems()
        {
            SqlConnection conn   = new SqlConnection(dbconn.Configuration());
            SqlCommand    cmd    = null;
            SqlDataReader rdr    = null;
            string        sqlsel = "select id, headline, description, category, picture from item";

            try
            {
                conn.Open();
                cmd = new SqlCommand(sqlsel, conn);
                rdr = cmd.ExecuteReader();

                GridViewItems.DataSource = rdr;
                GridViewItems.DataBind();
            }
            catch (Exception ex)
            {
                LabelMessage.Text = ex.Message;
            }
            finally
            {
                conn.Close();
            }
        }
        protected void BtnZoeken_Click(object sender, EventArgs e)
        {
            if (TbSearch.Text != "")
            {
                string soort = DdlCategorie.SelectedItem.ToString();
                string naam  = TbSearch.Text;

                GridViewItems.DataSource = Connectie.GetItems(soort, naam);
                GridViewItems.DataBind();
                if (GridViewItems.Rows.Count >= 1)
                {
                    if (soort == "Personage")
                    {
                        GridViewItems.AutoGenerateSelectButton = false;
                        BtnVoegToe.Visible = false;
                    }
                    else
                    {
                        BtnVoegToe.Visible = true;
                    }
                }
                else
                {
                    LbErrorZoek.Text      = "Geen items met deze naam aanwezig";
                    LbErrorZoek.ForeColor = System.Drawing.Color.Red;
                    LbErrorZoek.Visible   = true;
                }
            }
            else
            {
                LbErrorZoek.ForeColor = System.Drawing.Color.Red;
                LbErrorZoek.Text      = "Vul geldige informatie in";
                LbErrorZoek.Visible   = true;
            }
        }
        protected void BtnShow_Click(object sender, EventArgs e)
        {
            List <Item> ItemList = new List <Item>();

            PanelDetail.Visible = false;
            if (ddlItemID.SelectedValue == "all" && ddlDesc.SelectedValue == "all")
            {
                string category = ddlCate.SelectedValue.ToString();
                ItemList                 = VIC.GetItemByCategory(category);
                PanelTable.Visible       = true;
                Session["ItemList"]      = ItemList;
                GridViewItems.DataSource = ItemList;
                GridViewItems.DataBind();
            }
            else
            {
                string id = ddlItemID.SelectedValue.ToString();
                Item   i  = VIC.GetItemByItemID(id);
                PanelTable.Visible = true;
                ItemList.Add(i);
                Session["ItemList"]      = ItemList;
                GridViewItems.DataSource = ItemList;
                GridViewItems.DataBind();
            }
        }
 protected void BtnShowAll_Click(object sender, EventArgs e)
 {
     PanelDetail.Visible      = false;
     PanelTable.Visible       = true;
     Session["ItemList"]      = VIC.GetAllItem();
     GridViewItems.DataSource = VIC.GetAllItem();
     GridViewItems.DataBind();
 }
Beispiel #5
0
        public SecondPageViewModel(ISampleScreen screen) : base(screen)
        {
            for (int i = 0; i < 500; i++)
            {
                GridViewItems.Add(new GridViewItem(i));
            }

            NavigateBack = ReactiveCommand.CreateFromObservable(
                () => HostScreen.Router.NavigateBack.Execute(Unit.Default));
        }
Beispiel #6
0
 protected void btnEdit_Click(object sender, EventArgs e)
 {
     if (GXGridView1.SelectedIndex != -1)
     {
         int id = Convert.ToInt32(GXGridView1.SelectedValue);
         BrokeragesForMarketingAgent bfma = BrokeragesForMarketingAgent.Get(id);
         tbUserID.Text = bfma.UserID.ToString();
         tbName.Text   = Broker.DataAccess.User.GetUserById(bfma.UserID).Name;
         odsGridViewItems.SelectParameters.Clear();
         odsGridViewItems.SelectParameters.Add("UserID", bfma.UserID.ToString());
         GridViewItems.DataBind();
         mvMain.SetActiveView(ViewInsertBrokerages);
         mvBrokerages.SetActiveView(viewItemsGrid);
         btnNew.CssClass     = "novZapis";
         btnEdit.CssClass    = "izmeni_Active";
         btnPreview.CssClass = "osvezi";
         btnReport.CssClass  = "izvestaj";
         btnSearch.CssClass  = "prebaraj";
     }
 }
Beispiel #7
0
 protected void DetailsViewItems_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInInsertMode = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         int offerID = Convert.ToInt32(e.Values["UserID"]);
         //decimal offerItemCost = Convert.ToDecimal(e.Values["Cost"]);
         //Offer o = Offer.Get(offerID);
         //o.Cost += offerItemCost;
         //Offer.Table.Context.SubmitChanges();
         //odsOfferPreview.SelectParameters.Clear();
         //odsOfferPreview.SelectParameters.Add("id", offerID.ToString());
         //dvOfferPreview.DataBind();
         odsGridViewItems.SelectParameters.Clear();
         odsGridViewItems.SelectParameters.Add("userID", offerID.ToString());
         GridViewItems.DataBind();
         mvBrokerages.SetActiveView(viewItemsGrid);
     }
 }
 protected void DetailsViewItems_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
 {
     GridViewItems.DataBind();
 }
 protected void GridViewItems_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GridViewItems.PageIndex  = e.NewPageIndex;
     GridViewItems.DataSource = Session["ItemList"];
     GridViewItems.DataBind();
 }