Example #1
0
    protected void lnkOptions_Click(object sender, EventArgs e)
    {
        LinkButton ctrl = sender as LinkButton;

        string searchText = "";

        searchText = "LocID = '" + txtSearchCode.Text.Trim() + "'";


        dtLocationMaster = locationMaster.GetLocationMaster(searchText);

        HideAllControls();

        if (ctrl.ID == "lnkOptions")
        {
            tdOption.Style.Add(HtmlTextWriterStyle.Display, "");
            ucOption.SetOptionsValue = dtLocationMaster;
            pnlOption.Update();
        }
        else if (ctrl.ID == "lnkWarehouse")
        {
            tdWarehouse.Style.Add(HtmlTextWriterStyle.Display, "");
            ucWarehouse.SetWarehouseValue = dtLocationMaster;
            pnlWarehouse.Update();
        }
        else if (ctrl.ID == "lnkPrinters")
        {
            tdPrinter.Style.Add(HtmlTextWriterStyle.Display, "");
            ucPrinter.SetPrinterValue = dtLocationMaster;
            pnlPrinter.Update();
        }
    }
    public static string[] GetCompletionListLocationName(string prefixText, int count, string contextKey)
    {
        LocationMaster objLocationMaster = new LocationMaster();


        DataTable dt = new DataView(objLocationMaster.GetLocationMaster(HttpContext.Current.Session["CompId"].ToString()), "Location_Name like '" + prefixText.ToString() + "%'", "", DataViewRowState.CurrentRows).ToTable();

        dt = new DataView(dt, "Brand_Id='" + HttpContext.Current.Session["BrandId"].ToString() + "'", "", DataViewRowState.CurrentRows).ToTable();
        if (dt.Rows.Count == 0)
        {
            dt = objLocationMaster.GetLocationMaster(HttpContext.Current.Session["CompId"].ToString());
            dt = new DataView(dt, "Brand_Id='" + HttpContext.Current.Session["BrandId"].ToString() + "'", "", DataViewRowState.CurrentRows).ToTable();
        }
        else
        {
        }
        string[] txt = new string[dt.Rows.Count];

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            txt[i] = dt.Rows[i]["Location_Name"].ToString();
        }

        return(txt);
    }
Example #3
0
    public void filllocation(string BrandId, DropDownList ddl)
    {
        DataTable dt  = LM.GetLocationMaster(Session["CompId"].ToString());
        string    Loc = string.Empty;



        try
        {
            DataView dv = new DataView(dt);

            dv.RowFilter = "Brand_Id ='" + BrandId + "'";
            dt           = dv.ToTable();

            if (Loc.Length > 0)
            {
                dt = new DataView(dt, "Location_Id in (" + Loc.Substring(0, Loc.Length - 1) + ")", "Location_Name", DataViewRowState.CurrentRows).ToTable();
            }
            ddl.DataSource     = dt;
            ddl.DataTextField  = "Location_Name";
            ddl.DataValueField = "Location_Id";
            ddl.DataBind();
            ddl.Items.Insert(0, "--Select One--");
            ddl.SelectedIndex = 0;
        }
        catch
        { }
    }
Example #4
0
    protected void ddlBrand_SelectedIndexChanged(object sender, EventArgs e)
    {
        Session["BrandId"] = ddlBrand.SelectedValue.ToString();

        DataTable dtLoc = ObjLocationMaster.GetLocationMaster(Session["CompId"].ToString());

        dtLoc = new DataView(dtLoc, "Brand_Id='" + ddlBrand.SelectedValue + "'", "", DataViewRowState.CurrentRows).ToTable();


        string LocIds = GetRoleDataPermission(Session["RoleId"].ToString(), "L");

        if (!GetStatus(Session["RoleId"].ToString()))
        {
            if (LocIds != "")
            {
                dtLoc = new DataView(dtLoc, "Location_Id in(" + LocIds.Substring(0, LocIds.Length - 1) + ")", "", DataViewRowState.CurrentRows).ToTable();
            }
        }



        fillDropdown(ddlLocation, dtLoc, "Location_Name", "Location_Id");

        ddlLocation_SelectedIndexChanged(null, null);
    }