Пример #1
0
    private void PopulateManufacturer()
    {
        try
        {
            List<Manufacturer> lstManufacturer = new ManufacturerBLL().GetAll(new PageInfo());
            cmbManufacturer.DataSource = lstManufacturer;
            cmbManufacturer.DataValueField = "ManufacturerID";
            cmbManufacturer.DataTextField = "CompanyName";
            cmbManufacturer.DataBind();
            cmbManufacturer.Items.Insert(0, new ListItem("--Select--"));
            cmbManufacturer.SelectedIndex = 0;
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
Пример #2
0
    private void PopulateManufacturer()
    {
        List<Manufacturer> lstManufacturer = new ManufacturerBLL().GetAllActive();
        hdnManufacturer.Value = "";
        for (int i = 0; i < lstManufacturer.Count; i++)
        {
            hdnManufacturer.Value += lstManufacturer[i].ManufacturerID + "##" + lstManufacturer[i].CompanyName + "@@";
        }

        if (hdnManufacturer.Value.Length > 0)
        {
            hdnManufacturer.Value = hdnManufacturer.Value.Substring(0, hdnManufacturer.Value.Length - 2);
        }

        Common.BindControl(ddlManufacturer, lstManufacturer, "CompanyName", "ManufacturerID", Constants.ControlType.DropDownList, true);
    }
Пример #3
0
    private void PopulateManufacturerGrid()
    {
        try
        {
            if (txtSearch.Text.Trim() != "Search")
            {
                objPI.SearchText = txtSearch.Text.Trim();
            }
            else
            {
                objPI.SearchText = "";
            }

            if (objPI.SortDirection == null && objPI.SortColumnName == null)
            {
                objPI.SortDirection = Convert.ToString(ViewState[Constants.SORTDERECTION]);
                objPI.SortColumnName = Convert.ToString(ViewState[Constants.SORTCOLUMNNAME]);
            }
            List<Manufacturer> objData = new ManufacturerBLL().GetAll(objPI);

            gvGrid.DataSource = objData;
            gvGrid.ExportTemplate = "export_template_4Column.xlsx";
            gvGrid.ExportCaption = "";
            gvGrid.ExcelColumn = "";
            gvGrid.DataBind();

            /*if (objData != null)
            {
                if (!iFlag && lblMsg.Text == "")
                {
                    int mintMode = Common.GetQueryStringIntValue("Mode");
                    if (mintMode > 0)
                    {
                        if (mintMode == 1)
                        {
                            divMess.Attributes.Add("class", "success");
                            divMess.Visible = true;
                            lblMsg.Text = "-'" + objData[0].FirstName + "' " + Constants.Added;

                        }
                        else if (mintMode == 2)
                        {

                        }

                    }
                    else
                    {
                        divMess.Visible = false;
                        lblMsg.Text = "";
                    }
                }
                else
                {
                    if (lblMsg.Text == "")
                    {
                        divMess.Visible = false;
                        lblMsg.Text = "";
                    }
                }

            }*/

        }
        catch (Exception ex)
        {
            SendMail.MailMessage("CSWeb > Error > " + (new StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString());
        }
    }
    private void PopulateManufacturer()
    {
        List<Manufacturer> lstManufacturer = new ManufacturerBLL().GetAllActive();

        Common.BindControl(cmbManufacturer, lstManufacturer, "CompanyName", "ManufacturerID", Constants.ControlType.DropDownList, true);
    }