protected void btnAdd_click(object sender, EventArgs e)
{

try
{

//记录第几次追加
pressCount++;
typeString.Add(typeSelect.SelectedItem.ToString());
if (typeString.Count > 1)
{
for (int i = 0; i < typeString.Count - 1; i++)
{
if (typeString[typeString.Count - 1].Equals(typeString[i]))
{
string lastString = typeString[typeString.Count - 1];
typeString.Remove(lastString);
pressCount--;
return;
}
}
}
m_con = DataAccess.DbConn();

if (Session["sellerSave"].ToString().Trim().Equals("1"))
{
//是否选择種别
if (typeSelect.SelectedValue.ToString().Equals("0"))
{
//提示选择種别
ErrorHelp.alertMessageInAjax(Page, "S0100002");
}
else
{
DataTable tab_InfoResInfo = new DataTable();
tab_InfoResInfo.Columns.Add("type", typeof(string));
tab_InfoResInfo.Columns.Add("responsibleCD", typeof(string));
tab_InfoResInfo.Columns.Add("update_username", typeof(string));
tab_InfoResInfo.Columns.Add("update_date", typeof(string));
tab_InfoResInfo.Columns.Add("zipCode", typeof(string));
tab_InfoResInfo.Columns.Add("prefectures", typeof(string));
tab_InfoResInfo.Columns.Add("city", typeof(string));
tab_InfoResInfo.Columns.Add("detail1", typeof(string));
tab_InfoResInfo.Columns.Add("detail2", typeof(string));
tab_InfoResInfo.Columns.Add("email", typeof(string));
tab_InfoResInfo.Columns.Add("department", typeof(string));
tab_InfoResInfo.Columns.Add("title", typeof(string));
tab_InfoResInfo.Columns.Add("name", typeof(string));
tab_InfoResInfo.Columns.Add("tel", typeof(string));
tab_InfoResInfo.Columns.Add("mobile", typeof(string));
tab_InfoResInfo.Columns.Add("fax", typeof(string));
tab_InfoResInfo.Columns.Add("note", typeof(string));
for (int i = 0; i < pressCount; i++)
{

//添加行
DataRow dr = tab_InfoResInfo.NewRow();
tab_InfoResInfo.Rows.Add(dr);
}
//去重
distinct(typeString);
//list转换成数据
string[] typeArray = typeString.ToArray();
for (int i = 0; i < typeArray.Length; i++)
{
tab_InfoResInfo.Rows[i][0] = typeArray[i];
}
// tab_InfoResInfo.Rows[pressCount - 1][0] = Session["repeater_type_string"].ToString().Trim();
sellersIndex_Repeater.DataSource = tab_InfoResInfo;
sellersIndex_Repeater.DataBind();
for (int i = 0; i < this.sellersIndex_Repeater.Items.Count; i++)
{
RepeaterItem resItem = sellersIndex_Repeater.Items[i];
TextBox repeater_responsibleCDTextBox = (TextBox)resItem.FindControl("repeater_responsibleCD");
repeater_responsibleCDTextBox.ReadOnly = true;
repeater_responsibleCDTextBox.Enabled = false;

}
// resSave.Style.Add("display", "block");
// resSave.Style.Add("display", "block");

}
}
else
{
//请先保存販売先情報
ErrorHelp.alertMessageInAjax(Page, "S0100038");
}

}
catch (MySqlException ex)
{
lbl_error.Text = ex.ToString();
LogControl.CmnOutPutLOG(Const.PageCodes.ProCategoryManage, Const.ErrorLevel.ERROR, ex.ToString());
}
catch (Exception ex)
{
lbl_error.Text = ex.ToString();
LogControl.CmnOutPutLOG(Const.PageCodes.ProCategoryManage, Const.ErrorLevel.ERROR, ex.ToString());

}
finally
{
DataAccess.DbClose(m_con);
}

}

每次点击按钮后,判断页面是否已经有该行,没有弹出repeater的一行,并给他赋一个这行附值,没有则跳出的更多相关文章

  1. response 后刷新页面,点击按钮后,禁用该按钮

    一,正常的点击按钮后,将其灰显,全部执行完毕再正常显示. this.btnSave.Attributes.Add("onclick", "if (typeof(Page_ ...

  2. 【前台页面 BUG】回车按钮后,页面自动跳转

    点击回车按钮后,页面自动的迅速跳转 原因: 表单隐式提交了. 解决方法: 在方法执行完成后,加上return false; 代码如下: /** * 注册按钮的点击事件 */ $("#regi ...

  3. 如何让Web程序在点击按钮后出现如执行批处理程序般的效果

    在cli程序中,输入命令得到连续的输出已经是一种进度而美观的页面交互形式,好比下图: 而web程序里也有类似的场景,比如执行一个耗时任务,除了显示出等待图标外,用户还希望把执行的状态及时显示出来.如下 ...

  4. 使用Android点击按钮跳转页面

    1.首先新建一个Android工程,命名为MyApp(名字可以自己随意起); 2.以原有的MainActivity.java文件为登录界面,然后在src文件中的包上面右击选择New目录下的Other中 ...

  5. TProcedure,TMethod,TNotifyEvent,TWndMethod的区别,并模拟点击按钮后发生的动作

    忽然发现TProcedure和TNotifEvent的区别还挺大的: procedure TForm1.Button2Click(Sender: TObject); begin ShowMessage ...

  6. jeecg 弹出框 点击按钮回调父页面 返回值

    jeecg 弹出框 点击按钮回调父页面 返回值 <t:base type="jquery"></t:base> <t:base type=" ...

  7. Java基础 awt Button 点击按钮后在控制台输出文字

        JDK :OpenJDK-11      OS :CentOS 7.6.1810      IDE :Eclipse 2019‑03 typesetting :Markdown   code ...

  8. H5页面 绝对定位元素被 软键盘弹出时顶起

    H5页面 绝对定位元素被 软键盘弹出时顶起 在h5页面开发的过程中,我们可能会遇到下面这个问题,当页面中有输入框的时候,系统自带的软盘会把按钮挤出原来的位置.那么我们该怎么解决呢?下面列出一下的方法: ...

  9. 禁止手机页面中A标签长按弹出路径框

    //禁止手机页面中A标签长按弹出路径框    window.onload=function(){        document.documentElement.style.webkitTouchCa ...

随机推荐

  1. [c++] Iterators

    性质depends on various containers. 需要躲过的坑,野指针. int main() { cout << "Hello World!" < ...

  2. UML简介

    Unified Modeling Language (UML)又称统一建模语言或标准建模语言,是始于1997年一个OMG标准,它是一个支持模型化和软件系统开发的图形化语言,为软件开发的所有阶段提供模型 ...

  3. Nodejs学习笔记(四)——支持Mongodb

    前言:回顾前面零零碎碎写的三篇挂着Nodejs学习笔记的文章,着实有点名不副实,当然,这篇可能还是要继续走着离主线越走越远的路子,从简短的介绍什么是Nodejs,到如何寻找一个可以调试的Nodejs ...

  4. [git]merge和rebase的区别

    前言 我从用git就一直用rebase,但是新的公司需要用merge命令,我不是很明白,所以查了一些资料,总结了下面的内容,如果有什么不妥的地方,还望指正,我一定虚心学习. merge和rebase ...

  5. java类加载器-系统类加载器

    系统类加载器 系统类加载器可能都耳详能熟,但是为了完整点,还是先简单的说说系统的类加载器吧. public class Test { public static void main(String[] ...

  6. Windows Azure Active Directory (2) Windows Azure AD基础

    <Windows Azure Platform 系列文章目录> Windows Azure AD (WAAD)是Windows Azure提供的一个REST风格的服务,为您的云服务提供了身 ...

  7. 使用junit测试用例

    通常只会使用junit测试非main方法,在我眼里就是程序入口实现而已.今天,发现原来可以测试类. 针对mybatis练习.在需要测试的UserDaoImpl类上右键,新建一个junit case,位 ...

  8. Moon.Orm 5.0(MQL版)使用指南及代码生成器新版发布

    相关博文1)Moon.Orm 5.0 (MQL版) 配置说明; 2)Moon.Orm 5.0 (MQL版) 版本维护及下载(跟踪发布); 3)Moon.Orm 5.0系列文章;  4)Moon.Orm ...

  9. Ubuntu14.04安装JDK

    下载oracle jdk包 从oracle官网下载jdk包,请选择Linux的tar包: 如果想使用命令行下载工具进行下载,可以先获得下载地址,然后运行curl进行下载: curl -L -O -H ...

  10. 2013最新版Subversion 1.7.10 for Windows x86 + Apache 2.4.4 x64 安装配置教程+错误解决方案

    一 .工作环境 操作系统:Windows Server 2008 R2 SP1 x64 Apache版本:2.4.4 Subversion版本: Setup-Subversion-1.7.10.msi ...