protected void btnAdd_Click(Object Sender, EventArgs e) { if (intID == 0) { oWorkstation.AddComponent(txtName.Text, txtZEUSBuildType.Text, txtADMoveLocation.Text, (chkSMSInstall.Checked ? 1 : 0), txtScript.Text, txtWorkstationGroup.Text, txtUserGroup.Text, txtNotifications.Text, (oWorkstation.GetComponents(0).Tables[0].Rows.Count + 1), (chkEnabled.Checked ? 1 : 0)); } else { oWorkstation.UpdateComponent(intID, txtName.Text, txtZEUSBuildType.Text, txtADMoveLocation.Text, (chkSMSInstall.Checked ? 1 : 0), txtScript.Text, txtWorkstationGroup.Text, txtUserGroup.Text, txtNotifications.Text, (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); oWorkstation.UpdateComponentOrder(intId, intCount); } } Response.Redirect(Request.Path); }