本文整理汇总了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;
}
}
示例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;
}
}
示例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)
{
}
}
示例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;
}
}
示例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();
}
}
示例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;
}
}
示例7: GetAgents
DataSet GetAgents()
{
try
{
objBal = new ClsBAL();
return objBal.GetAllTYpes(ddltype.SelectedValue);
}
catch (Exception ex)
{
// lblMsg.InnerHtml = ex.Message;
throw;
}
}
示例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;
}
}