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


C# ClsBAL.UpdateSource方法代码示例

本文整理汇总了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;
        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:81,代码来源:Cities.aspx.cs

示例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;
        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:84,代码来源:Cities.aspx.cs


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