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


C# ClsBAL.UpdateSourceStatus方法代码示例

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


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

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