本文整理汇总了C#中BAL.ClsBAL.UpdateSource方法的典型用法代码示例。如果您正苦于以下问题:C# ClsBAL.UpdateSource方法的具体用法?C# ClsBAL.UpdateSource怎么用?C# ClsBAL.UpdateSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BAL.ClsBAL
的用法示例。
在下文中一共展示了ClsBAL.UpdateSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
objBal = new ClsBAL();
string lblFirstOriginalId = "";
string lblModifiedId = "";
string Bit = "";
string Tig = "";
string Abh = "";
string BitIds = "";
string TigIds = "";
string AbhIds = "";
string[] lblIDs = new string[gv.Rows.Count];
string[] lblOriginalIDs = new string[gv.Rows.Count];
string[] lblSourceNames = new string[gv.Rows.Count];
string[] lblStatuss = new string[gv.Rows.Count];
foreach (GridViewRow row in gv.Rows)
{
Label lblID = (Label)row.FindControl("lblID");
Label lblOriginalID = (Label)row.FindControl("lblOriginalID");
Label lblSourceName = (Label)row.FindControl("lblSourceName");
Label lblStatus = (Label)row.FindControl("lblStatus");
lblIDs[row.RowIndex] = lblID.Text.ToString();
lblOriginalIDs[row.RowIndex] = lblOriginalID.Text.ToString();
lblSourceNames[row.RowIndex] = lblSourceName.Text.ToString();
lblStatuss[row.RowIndex] = lblStatus.Text.ToString();
if (row.RowIndex > 0)
{
objBal.UpdateSource("FALSE", lblOriginalID.Text.ToString(), lblOriginalID.Text.ToString());
}
if (row.RowIndex == 0) { lblFirstOriginalId = lblOriginalID.Text.ToString(); }
}
foreach (string item in lblOriginalIDs)
{
foreach (string item1 in item.Split(':'))
{
foreach (string item2 in item1.Split('-'))
{
if (item2 == "Bit")
{
Bit = item2 + "-"; if (BitIds == "")
{ BitIds = item1.Split('-')[1].ToString(); }
else { BitIds = BitIds + "," + item1.Split('-')[1].ToString(); }
}
if (item2 == "Tig")
{
Tig = item2 + "-"; if (TigIds == "")
{ TigIds = item1.Split('-')[1].ToString(); }
else { TigIds = TigIds + "," + item1.Split('-')[1].ToString(); }
}
if (item2 == "Abh")
{
Abh = item2 + "-"; if (AbhIds == "")
{ AbhIds = item1.Split('-')[1].ToString(); }
else { AbhIds = AbhIds + "," + item1.Split('-')[1].ToString(); }
}
}
}
}
lblModifiedId = Bit + BitIds + ":" + Tig + TigIds + ":" + Abh + AbhIds;
objBal.UpdateSource("TRUE", lblFirstOriginalId, lblModifiedId);
ddlLetter_SelectedIndexChanged(sender, e);
}
catch (Exception)
{
throw;
}
}
示例2: gvCities_RowCommand
protected void gvCities_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
{
try
{
if (e.CommandName == "TRUEorFALSE")
{
LinkButton lbtn = (LinkButton)e.CommandSource;
string status = "";
if (lbtn.ToolTip == "TRUE") { status = "FALSE"; } else { status = "TRUE"; }
objBal = new ClsBAL();
objBal.UpdateSourceStatus(status, e.CommandArgument.ToString());
DataSet ds = GetCitiesByLetter(ddlLetter.SelectedItem.Text.ToString());
gvCities.DataSource = ds;
gvCities.DataBind();
}
else if (e.CommandName == "OriginalIDtoID")
{
LinkButton lbtn = (LinkButton)e.CommandSource;
//string status = "";
//if (lbtn.ToolTip == "TRUE") { status = "FALSE"; } else { status = "TRUE"; }
objBal = new ClsBAL();
objBal.UpdateSource(lbtn.ToolTip.ToString(), e.CommandArgument.ToString(), e.CommandArgument.ToString());
DataSet ds = GetCitiesByLetter(ddlLetter.SelectedItem.Text.ToString());
gvCities.DataSource = ds;
gvCities.DataBind();
}
else if (e.CommandName == "SELECT")
{
LinkButton lbtn = (LinkButton)e.CommandSource;
GridViewRow row = (GridViewRow)lbtn.NamingContainer;
Label lblID = (Label)row.FindControl("lblID");
Label lblOriginalID = (Label)row.FindControl("lblOriginalID");
Label lblSourceName = (Label)row.FindControl("lblSourceName");
Label lblStatus = (Label)row.FindControl("lblStatus");
LinkButton lbtnMakeIt = (LinkButton)row.FindControl("lbtnMakeIt");
DataTable dtSources = null;
if (HttpContext.Current.Session["Cities"] == null)
{
dtSources = new DataTable();
dtSources.Columns.Add("ID");
dtSources.Columns.Add("OriginalID");
dtSources.Columns.Add("SourceName");
dtSources.Columns.Add("Status");
DataRow dr = dtSources.NewRow();
dr["ID"] = lblID.Text.ToString();
dr["OriginalID"] = lblOriginalID.Text.ToString();
dr["SourceName"] = lblSourceName.Text.ToString();
dr["Status"] = lblStatus.Text.ToString();
dtSources.Rows.Add(dr);
HttpContext.Current.Session["Cities"] = dtSources;
}
else
{
dtSources = (DataTable)HttpContext.Current.Session["Cities"];
DataRow dr = dtSources.NewRow();
dr["ID"] = lblID.Text.ToString();
dr["OriginalID"] = lblOriginalID.Text.ToString();
dr["SourceName"] = lblSourceName.Text.ToString();
dr["Status"] = lblStatus.Text.ToString();
dtSources.Rows.Add(dr);
HttpContext.Current.Session["Cities"] = dtSources;
}
gv.Visible = true;
gv.DataSource = dtSources;
gv.DataBind();
if (gv.Rows.Count > 1) { btnSubmit.Visible = true; } else { btnSubmit.Visible = false; }
}
}
catch (Exception)
{
throw;
}
}