protected void btnAdd_Click(Object Sender, EventArgs e) { int intType = Int32.Parse(Request.Form[hdnParent.UniqueID]); if (intID == 0) { oOnDemand.AddStep(intType, txtName.Text, txtTitle.Text, txtPath.Text, txtScript.Text, txtScriptDone.Text, txtInteraction.Text, (radZEUS.Checked ? 1 : 0), (radPower.Checked ? 1 : 0), (radAccounts.Checked ? 1 : 0), (radInstalls.Checked ? 1 : 0), (radGroups.Checked ? 1 : 0), Int32.Parse(ddlType.SelectedItem.Value), (chkResume.Checked ? 1 : 0), (chkShowBuild.Checked ? 1 : 0), oOnDemand.GetSteps(intType, 0).Tables[0].Rows.Count + 1, (chkEnabled.Checked ? 1 : 0)); } else { oOnDemand.UpdateStep(intID, txtName.Text, txtTitle.Text, txtPath.Text, txtScript.Text, txtScriptDone.Text, txtInteraction.Text, (radZEUS.Checked ? 1 : 0), (radPower.Checked ? 1 : 0), (radAccounts.Checked ? 1 : 0), (radInstalls.Checked ? 1 : 0), (radGroups.Checked ? 1 : 0), Int32.Parse(ddlType.SelectedItem.Value), (chkResume.Checked ? 1 : 0), (chkShowBuild.Checked ? 1 : 0), (chkEnabled.Checked ? 1 : 0)); } if (Request.Form[hdnOrder.UniqueID] != "") { string strOrder = Request.Form[hdnOrder.UniqueID]; int intCount = 0; while (strOrder != "") { intCount++; int intId = Int32.Parse(strOrder.Substring(0, strOrder.IndexOf("&"))); strOrder = strOrder.Substring(strOrder.IndexOf("&") + 1); oOnDemand.UpdateStepOrder(intId, intCount); } } Response.Redirect(Request.Path); }