foreach (CCBusiness.AttributeValues obja in objval) { if (obja != null) { attributeID = obja.AttributeID; validation = obja.Validation; for (int t = 0; t < tblAttributeView.Rows.Count; t++) { if (obja.DataType == "ip") { for (int s = 0; s < 4; s++) { controlID = "ATT" + Convert.ToString(CurrentIndex ) + Convert.ToString(attributeID) + "-" + (s + 1); Control c = tblAttributeView.Rows[t].FindControl(controlID); Control c1 = tblAttributeView.Rows[t].FindControl(controlID); Control c2 = tblAttributeView.Rows[t].FindControl(controlID); if (c is System.Web.UI.WebControls.TextBox) { TextBox txt = (TextBox)c; txt.Text = SplitIpAddress(validation)[s]; } //25/03 //Control c1 = tblAttributeView.Rows[t].FindControl(controlID); if (c1 is System.Web.UI.WebControls.TextBox) { TextBox txt = (TextBox)c1; txt.Text = SplitIpAddress(validation)[s]; } //Control c2 = tblAttributeView.Rows[t].FindControl(controlID); if (c2 is System.Web.UI.WebControls.TextBox) { TextBox txt = (TextBox)c2; txt.Text = SplitIpAddress(validation)[s]; } //25/03 } } else { if (CCBusiness.ProductClass.ProductTypes.Package == (CCBusiness.ProductClass.ProductTypes)productType) controlID = "ATT" + Convert.ToString(CurrentIndex) + "ddlTemplate"; else controlID = "ATT" + Convert.ToString(CurrentIndex) + Convert.ToString(attributeID); //.......... Control c = tblAttributeView.Rows[t].FindControl(controlID); if (c is System.Web.UI.WebControls.DropDownList) { DropDownList ddl = (DropDownList)c; ddl.SelectedValue = validation; if (validation == "") ddl.SelectedIndex = 0; } else if (c is System.Web.UI.WebControls.TextBox) { TextBox txt = (TextBox)c; txt.Text = validation; } else if (c is DateTimeSelector) { DateTimeSelector dts = (DateTimeSelector)c; if (ConvertDate(validation) != "") dts.Date = string.Format("{0:dd MMM yy}", Convert.ToDateTime(ConvertDate(validation))); } //................ //////........ if (CCBusiness.ProductClass.ProductTypes.Package == (CCBusiness.ProductClass.ProductTypes)productType) controlID = "ATT" + Convert.ToString(CurrentIndex) + "ddlcontract_term"; else controlID = "ATT" + Convert.ToString(CurrentIndex) + Convert.ToString(attributeID); //.............. Control c1 = tblAttributeView.Rows[t].FindControl(controlID); if (c1 is System.Web.UI.WebControls.DropDownList) { DropDownList ddl = (DropDownList)c1; ddl.SelectedValue = validation; //ddl.SelectedItem.Text = validation; if (validation == "") ddl.SelectedIndex = 0; } else if (c1 is System.Web.UI.WebControls.TextBox) { TextBox txt = (TextBox)c1; txt.Text = validation; } else if (c1 is DateTimeSelector) { DateTimeSelector dts = (DateTimeSelector)c1; if (ConvertDate(validation) != "") dts.Date = string.Format("{0:dd MMM yy}", Convert.ToDateTime(ConvertDate(validation))); } //////............. if (CCBusiness.ProductClass.ProductTypes.Package == (CCBusiness.ProductClass.ProductTypes)productType) controlID = "ATT" + Convert.ToString(CurrentIndex) + "ddlContract_unit"; else controlID = "ATT" + Convert.ToString(CurrentIndex) + Convert.ToString(attributeID); //.................. Control c2 = tblAttributeView.Rows[t].FindControl(controlID); if (c2 is System.Web.UI.WebControls.DropDownList) { DropDownList ddl = (DropDownList)c2; ddl.SelectedValue = validation; //ddl.SelectedItem.Text = validation; if (validation == "") ddl.SelectedIndex = 0; } else if (c2 is System.Web.UI.WebControls.TextBox) { TextBox txt = (TextBox)c2; txt.Text = validation; } else if (c2 is DateTimeSelector) { DateTimeSelector dts = (DateTimeSelector)c2; if (ConvertDate(validation) != "") dts.Date = string.Format("{0:dd MMM yy}", Convert.ToDateTime(ConvertDate(validation))); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)