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


C# ClsBAL.GetAllTYpes方法代码示例

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


在下文中一共展示了ClsBAL.GetAllTYpes方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getdistributors

    protected void getdistributors()
    {
        try
        {
            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)
                    {
                        gvAgents.DataSource = ds.Tables[0];
                        gvAgents.DataBind();
                    }
                }
            }

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

示例4: lnkViewBSD_Click

    protected void lnkViewBSD_Click(object sender, EventArgs e)
    {
        try
        {
            ViewState["Link"] = "View Distributors";

            divAgents.Visible = true; divAgentRegistration.Visible = false; divDeposits.Visible = false;
            lbtnViewAgents.Font.Bold = true;
            lbtnRegisterAgent.Font.Bold = false;
            lbtnDeposits.Font.Bold = false;
            ClsBAL obj = new ClsBAL();
            DataSet ds = (DataSet)obj.GetAllTYpes("BSD");
            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        gvAgents.DataSource = ds.Tables[0];
                        gvAgents.DataBind();
                    }
                }
            }

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

示例5: lnkbtnEmployee_Click

    protected void lnkbtnEmployee_Click(object sender, EventArgs e)
    {
        if (Session["Role"].ToString() == "Admin")
        {

            try
            {
                ViewState["Link"] = "View Distributors";

                divAgents.Visible = true; divAgentRegistration.Visible = false; divDeposits.Visible = false;
                lbtnViewAgents.Font.Bold = true;
                lbtnRegisterAgent.Font.Bold = false;
                lbtnDeposits.Font.Bold = false;
                ClsBAL obj = new ClsBAL();
                DataSet ds = (DataSet)obj.GetAllTYpes("Employee");
                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            gvAgents.DataSource = ds.Tables[0];
                            gvAgents.DataBind();
                        }
                    }
                }

            }
            catch (Exception ex)
            {
                lblMsg.InnerHtml = ex.Message;
            }
        }
        else
        {
            divAgents.Visible = true;
            getempsbybsd();

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

示例6: lbtnDistributorsDeposits_Click

    protected void lbtnDistributorsDeposits_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 = "";

            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)
                    {
                        Session["Deposits"] = "DisDeposits";
                        ddlAgents.DataSource = ds;
                        ddlAgents.DataTextField = "Username";
                        ddlAgents.DataValueField = "AgentId";
                        ddlAgents.DataBind();
                        ddlAgents.Items.Insert(0, "Please Select");
                        gvDeposits.DataSource = null; gvDeposits.DataBind();
                    }
                }
            }

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

示例7: GetAgents

 DataSet GetAgents()
 {
     try
       {
           objBal = new ClsBAL();
           return objBal.GetAllTYpes(ddltype.SelectedValue);
       }
       catch (Exception ex)
       {
          // lblMsg.InnerHtml = ex.Message;
           throw;
       }
 }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:13,代码来源:AgentReports.aspx.cs

示例8: getusers

    protected void getusers()
    {
        try
        {
            objBal = new ClsBAL();
            DataSet ds = objBal.GetAllTYpes("User");
            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {

                    gvAgents.DataSource = ds.Tables[0];
                    ViewState["Users"] = ds.Tables[0];
                    gvAgents.DataBind();
                }
            }
            else
            {
                lblMsg.InnerHtml = "No Data Found";
            }

        }
        catch (Exception)
        {

            throw;
        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:28,代码来源:ViewUserInformation.aspx.cs


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