public void FillPSR()
        {
            string query = @"Select PSR_Code +'-'+ PSR_Name as PSRName,PSR_Code from [ax].[ACXPSRMaster] where PSR_Code  " +
                           " in (select A.PSRCode from [ax].[ACXPSRBeatMaster] A  " +
                           " left Join [ax].[ACXPSRSITELinkingMaster] B on A.PSRCode = B.PSRCode " +
                           " where B.Site_code ='" + Session["SiteCode"].ToString() + "')";

            drpPSRNew.Items.Clear();
            drpPSRNew.Items.Add("Select...");
            baseobj.BindToDropDownp(drpPSRNew, query, "PSRName", "PSR_Code");
        }
        private void FillDdlList()
        {
            string    query = string.Empty;
            DataTable dt    = new DataTable();

            query = @"SELECT VersionName ,VersionName +'-'+ Description VersionInfo FROM ACX_VW_GetVersionInfo Where IsConfirm='Yes' Order By VersionName";
            ddlVersionNew.Items.Clear();
            ddlVersionNew.Items.Add("Select...");
            baseobj.BindToDropDownp(ddlVersionNew, query, "VersionInfo", "VersionName");

            ddlVersionCodeNew.Items.Clear();
            query = @"SELECT 'Un-Assigned' AS VersionName UNION SELECT VersionName FROM ACX_VW_GetVersionInfo Order By VersionName";
            dt    = baseobj.GetData(query);
            ddlVersionCodeNew.DataSource     = dt;
            ddlVersionCodeNew.DataTextField  = "VersionName";
            ddlVersionCodeNew.DataValueField = "VersionName";
            ddlVersionCodeNew.DataBind();
            //baseobj.BindToDropDown(ddlVersionCode, query, "VersionName", "VersionName");

            query = @"SELECT STATEID,NAME FROM AX.LOGISTICSADDRESSSTATE ORDER BY NAME";
            //baseobj.BindToDropDown(ddlState, query, "Name", "STATEID");
            ddlStateNew.Items.Clear();
            dt = baseobj.GetData(query);
            ddlStateNew.DataSource     = dt;
            ddlStateNew.DataTextField  = "Name";
            ddlStateNew.DataValueField = "STATEID";
            ddlStateNew.DataBind();


            query = @"SELECT 'VRS' AS NAME UNION SELECT 'PSR' AS NAME ORDER BY NAME";
            //baseobj.BindToDropDown(ddlUserType, query, "Name", "ID");
            ddlUserTypeNew.Items.Clear();
            dt = baseobj.GetData(query);
            ddlUserTypeNew.DataSource     = dt;
            ddlUserTypeNew.DataTextField  = "Name";
            ddlUserTypeNew.DataValueField = "Name";
            ddlUserTypeNew.DataBind();

            query = @"SELECT 'YES' AS NAME UNION SELECT 'NO' AS NAME ORDER BY NAME";
            ddlIsBlockNew.Items.Clear();
            dt = baseobj.GetData(query);
            ddlIsBlockNew.DataSource     = dt;
            ddlIsBlockNew.DataTextField  = "Name";
            ddlIsBlockNew.DataValueField = "Name";
            ddlIsBlockNew.DataBind();
            //baseobj.BindToDropDown(ddlIsBlock, query, "Name", "ID");
        }
Esempio n. 3
0
        void loadPSR()
        {
            //string strSite = ddlSiteId.SelectedValue.ToString();
            string strSite = "";


            foreach (System.Web.UI.WebControls.ListItem litem1 in lstSiteId.Items)
            {
                if (litem1.Selected)
                {
                    if (strSite.Length == 0)
                    {
                        strSite = "" + litem1.Value.ToString() + "";
                    }
                    else
                    {
                        strSite += "," + litem1.Value.ToString() + "";
                    }
                }
            }


            string strQuery = "";

            if (Convert.ToString(Session["LOGINTYPE"]) == "3")
            {
                //strSite = ucRoleFilters.GetCommaSepartedSiteId();
                strQuery = @"Select PSR_Code +'-'+ PSR_Name as PSRName,PSR_Code from [ax].[ACXPSRMaster] where PSR_Code  " +
                           " in (select A.PSRCode from [ax].[ACXPSRBeatMaster] A  " +
                           " left Join [ax].[ACXPSRSITELinkingMaster] B on A.PSRCode = B.PSRCode " +
                           " where B.Site_code  IN (" + strSite + ")";
            }
            else
            {
                strQuery = @"Select PSR_Code +'-'+ PSR_Name as PSRName,PSR_Code from [ax].[ACXPSRMaster] where PSR_Code  " +
                           " in (select A.PSRCode from [ax].[ACXPSRBeatMaster] A  " +
                           " left Join [ax].[ACXPSRSITELinkingMaster] B on A.PSRCode = B.PSRCode " +
                           " where B.Site_code IN (" + strSite + "))";
            }

            ddlPSRNew.Items.Clear();
            ddlPSRNew.Items.Add("Select...");
            baseObj.BindToDropDownp(ddlPSRNew, strQuery, "PSRName", "PSR_Code");
        }
        protected void ddlScheme_SelectedIndexChanged(object sender, EventArgs e)
        {
            string strSubQuery;

            strSubQuery = "";
            if ((Session["ISDISTRIBUTOR"].ToString() == "Y"))
            {
                if (ddlSchemeNew.SelectedIndex == 1)
                {
                    strSubQuery = "AND SALESCODE='" + Convert.ToString(Session["SCHSTATE"]) + "'";
                }
                if (ddlSchemeNew.SelectedIndex == 2)
                {
                    strSubQuery = "AND SALESCODE IN (" + ucRoleFilters.GetCommaSepartedSiteId() + ")";
                }
                if (ddlSchemeNew.SelectedIndex == 0)
                {
                    strSubQuery = "AND (SALESCODE IN (" + ucRoleFilters.GetCommaSepartedSiteId() + ") or SALESCODE='" + Convert.ToString(Session["SCHSTATE"]) + "' or SALESCODE='') ";
                }
            }
            string strQuery = "";

            if (ddlSchemeNew.SelectedItem.Text != "All")
            {
                strQuery = "Select Distinct SCHEMECODE,[Scheme Description] from [dbo].[ACXSCHEMEVIEW] where SCHEMECODE <>'' and [Sales Type] ='" + ddlSchemeNew.SelectedItem.Text + "'" + strSubQuery;
            }
            else
            {
                strQuery = "Select Distinct SCHEMECODE,[Scheme Description] from [dbo].[ACXSCHEMEVIEW] where SCHEMECODE <>'' " + strSubQuery;
            }

            ddlSiteIdNew.Items.Clear();
            ddlSiteIdNew.Items.Add("Select...");

            baseObj.BindToDropDownp(ddlSiteIdNew, strQuery, "Scheme Description", "SCHEMECODE");
            ReportViewer1.Visible = false;
        }