示例#1
0
    private void ShowCarPartsContentWithSearch()
    {
        var data = new List <CarPartDetails>();
        // get data.
        int selectedindex = Convert.ToInt32(ddlcarPartType.SelectedIndex);

        if (selectedindex > 0)
        {
            data = new CarPartsManager().GetAllCarPartsBycarPartType(txtName.Text.Trim(), selectedindex);
        }
        else
        {
            data = new CarPartsManager().GetAllCarParts(txtName.Text.Trim());
        }
        if (data != null)
        {
            foreach (var item in data)
            {
                var model = new CarPartsImagesManager().CarPartHasMainImage(item.CarPartId);
                if (model.Count() == 0)
                {
                    item.ImageUrl = "20_bQT1WmUM.jpg";
                }
                else
                {
                    item.ImageUrl = model.Where(x => x.IsMain == true).FirstOrDefault().Url;
                }
            }
            // show home news
            lvCarParts.DataSource = data;
            lvCarParts.DataBind();
        }
        FillLists.FillCarPartTypesList(ddlcarPartType);
        if (selectedindex > 0)
        {
            ddlcarPartType.SelectedValue = selectedindex.ToString();
        }
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Fill page drop lists.
            FillLists.FillCarsSaleProperties(ddlClient, ddlDistination);

            //try
            //{
            if (Page.RouteData.Values["Id"] != null) // edit invoice
            {
                hfId.Value = Page.RouteData.Values["Id"].ToString();
                long Id = Convert.ToInt64(hfId.Value);
                ShowInvoiceDetails(Id);
            }
            else if (Request.QueryString["id"] != null) // new invoice
            {
                hfCarID.Value = Request.QueryString["id"];
                int Id = Convert.ToInt32(hfCarID.Value);
                ShowSaleDetails(Id);
            }
            //} catch { }
        }
    }
示例#3
0
 private void FillDropList()
 {
     FillLists.FillAuctionsBuyers(ddlAuctionID, ddlClientID, ddlAuctionType);
 }
示例#4
0
 private void FillOptionsLists()
 {
     #region "Fill Lists"
     FillLists.FillCarPartTypesList(ddlcarPartType);
     #endregion
 }