当前位置: 首页>>代码示例>>C#>>正文


C# ClsBAL.GetAgentsbyDistributorID方法代码示例

本文整理汇总了C#中BAL.ClsBAL.GetAgentsbyDistributorID方法的典型用法代码示例。如果您正苦于以下问题:C# ClsBAL.GetAgentsbyDistributorID方法的具体用法?C# ClsBAL.GetAgentsbyDistributorID怎么用?C# ClsBAL.GetAgentsbyDistributorID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BAL.ClsBAL的用法示例。


在下文中一共展示了ClsBAL.GetAgentsbyDistributorID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: gvAgents_Sorting

    protected void gvAgents_Sorting(object sender, GridViewSortEventArgs e)
    {
        try
        {
            string strExpression = e.SortExpression;
            string strDirection = ViewState["SortDirection"].ToString();
            if (Session["Role"].ToString() == "Admin")
            {

                if (ViewState["Link"].ToString() == "View Distributors")
                {

                    ClsBAL obj = new ClsBAL();
                    DataSet ds = (DataSet)obj.GetAllTYpes("Distributor");
                    if (ds != null)
                    {
                        if (ds.Tables.Count > 0)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                DataTable dt = ds.Tables[0];
                                DataView dv = new DataView(dt);
                                dv.Sort = strExpression + strDirection;
                                gvAgents.DataSource = dv;
                                gvAgents.DataBind();
                            }
                        }
                    }
                }

                else
                {
                    DataTable dt = GetAgents().Tables[0];
                    DataView dv = new DataView(dt);
                    dv.Sort = strExpression + strDirection;
                    gvAgents.DataSource = dv;
                    gvAgents.DataBind();
                }
            }
            else
            {
                ClsBAL obj = new ClsBAL();
                DataSet ds = (DataSet)obj.GetAgentsbyDistributorID(Convert.ToInt32(Session["UserID"].ToString()));
                DataTable dt = ds.Tables[0];
                DataView dv = new DataView(dt);
                dv.Sort = strExpression + strDirection;
                gvAgents.DataSource = dv;
                gvAgents.DataBind();

            }
            if (strDirection == " ASC") { ViewState["SortDirection"] = " DESC"; } else { ViewState["SortDirection"] = " ASC"; }
        }
        catch (Exception ex)
        {
            lblMsg.InnerHtml = ex.Message;
        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:57,代码来源:Agents.aspx.cs

示例2: GetAgentNames

    public static string[] GetAgentNames(string prefixText)
    {
        try
        {

            DataSet ds = new DataSet();

            ClsBAL objBal = new ClsBAL();

            if (HttpContext.Current.Session["Deposits"].ToString() == "AgentDeposits")
            {
                ds = objBal.GetAgents();
                string filteringquery = "Username LIKE '" + prefixText + "%'";
                //Select always return array,thats why we store it into array of Datarow
                DataRow[] dr = ds.Tables[0].Select(filteringquery);
                //create new table
                DataTable dtNew = new DataTable();
                //create a clone of datatable dt and store it into new datatable
                dtNew = ds.Tables[0].Clone();
                //fetching all filtered rows add add into new datatable
                foreach (DataRow drNew in dr)
                {
                    dtNew.ImportRow(drNew);
                }
                //return dtAirportCodes;

                List<string> airports = new List<string>();
                for (int i = 0; i < dtNew.Rows.Count; i++)
                {
                    airports.Add(dtNew.Rows[i]["Username"].ToString().Trim());
                }
                return airports.ToArray();
            }

            else if (HttpContext.Current.Session["Deposits"].ToString() == "DisDeposits")
            {
                ds = objBal.GetAllTYpes("Distributor");
                string filteringquery = "Username LIKE '" + prefixText + "%'";
                //Select always return array,thats why we store it into array of Datarow
                DataRow[] dr = ds.Tables[0].Select(filteringquery);
                //create new table
                DataTable dtNew = new DataTable();
                //create a clone of datatable dt and store it into new datatable
                dtNew = ds.Tables[0].Clone();
                //fetching all filtered rows add add into new datatable
                foreach (DataRow drNew in dr)
                {
                    dtNew.ImportRow(drNew);
                }
                //return dtAirportCodes;

                List<string> airports = new List<string>();
                for (int i = 0; i < dtNew.Rows.Count; i++)
                {
                    airports.Add(dtNew.Rows[i]["Username"].ToString().Trim());
                }
                return airports.ToArray();
            }
            else
            {
                ds = objBal.GetAgentsbyDistributorID(Convert.ToInt32(HttpContext.Current.Session["UserID"].ToString()));
                string filteringquery = "Username LIKE '" + prefixText + "%'";
                //Select always return array,thats why we store it into array of Datarow
                DataRow[] dr = ds.Tables[0].Select(filteringquery);
                //create new table
                DataTable dtNew = new DataTable();
                //create a clone of datatable dt and store it into new datatable
                dtNew = ds.Tables[0].Clone();
                //fetching all filtered rows add add into new datatable
                foreach (DataRow drNew in dr)
                {
                    dtNew.ImportRow(drNew);
                }
                //return dtAirportCodes;

                List<string> airports = new List<string>();
                for (int i = 0; i < dtNew.Rows.Count; i++)
                {
                    airports.Add(dtNew.Rows[i]["Username"].ToString().Trim());
                }
                return airports.ToArray();
            }

        }
        catch (Exception)
        {
            throw;

        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:90,代码来源:Agents.aspx.cs

示例3: getagentsbydistributors

    protected void getagentsbydistributors()
    {
        try
        {
            ClsBAL obj = new ClsBAL();
            DataSet ds = (DataSet)obj.GetAgentsbyDistributorID(Convert.ToInt32(Session["UserID"].ToString()));
            if (ds != null)

                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        if (Session["Role"].ToString() == "BSD")
                        {
                            gvAgents.DataSource = ds.Tables[1];
                            ViewState["Users1"] = ds.Tables[1];
                            gvAgents.DataBind();
                        }
                        else
                        {
                            gvAgents.DataSource = ds.Tables[0];
                            ViewState["Users1"] = ds.Tables[0];
                            gvAgents.DataBind();
                        }
                    }
                }
        }

        catch (Exception ex)
        {
        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:32,代码来源:Agents.aspx.cs

示例4: lbtnDeposits_Click

    protected void lbtnDeposits_Click(object sender, EventArgs e)
    {
        try
        {
            txtAgents.Text = "";
            lbtnViewAgents.Font.Bold = false;
            lbtnRegisterAgent.Font.Bold = false;
            lbtnDeposits.Font.Bold = true;
            divAgents.Visible = false; divAgentRegistration.Visible = false; divDeposits.Visible = true;
            txtAmount.Text = txtDepositDetails.Text = "";

            if (Session["Role"].ToString() == "Admin")
            {
                Session["Deposits"] = "AgentDeposits";
                DataSet ds = GetAgents();
                ddlAgents.DataSource = ds;
                ddlAgents.DataTextField = "Username";
                ddlAgents.DataValueField = "AgentId";
                ddlAgents.DataBind();
                ddlAgents.Items.Insert(0, "Please Select");
                gvDeposits.DataSource = null; gvDeposits.DataBind();
            }
            else if (Session["Role"].ToString() == "Distributor")
            {
                ClsBAL objbal = new ClsBAL();
                Session["Deposits"] = "DistributorAgentDeposits";
                DataSet ds = objbal.GetAgentsbyDistributorID(Convert.ToInt32(Session["UserID"].ToString()));
                ddlAgents.DataSource = ds;
                ddlAgents.DataTextField = "Username";
                ddlAgents.DataValueField = "AgentId";
                ddlAgents.DataBind();
                ddlAgents.Items.Insert(0, "Please Select");
                gvDeposits.DataSource = null; gvDeposits.DataBind();
            }

            BindDepositRequests();

            txtTransactionNo.Text = ""; rbtnType.SelectedIndex = -1;
        }
        catch (Exception ex)
        {
            lblMsg.InnerHtml = ex.Message;
            throw;
        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:45,代码来源:Agents.aspx.cs


注:本文中的BAL.ClsBAL.GetAgentsbyDistributorID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。