protected void btnAdd_Click (object sender, EventArgs e)
{
Try
{
Record the number of times to append
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"))
{
Whether to choose species
if (typeSelect.SelectedValue.ToString (). Equals ("0"))
{
Tips for choosing a species
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++)
{
Adding rows
DataRow dr = Tab_inforesinfo.newrow ();
TAB_INFORESINFO.ROWS.ADD (DR);
}
Go heavy
Distinct (typestring);
The list is converted into data
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
{
Please save Sellers Ó first
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);
}
}
Each time you click on the button, determine whether the page has the line, there is no popup repeater line, and give him a line attached to the value, no jump