protected void btnAdd_Click(Object Sender, EventArgs e) { if (Request.Form[hdnId.UniqueID] == "0") { oOperatingSystems.Add(txtName.Text, (chkCluster.Checked ? 1 : 0), (chkWorkstation.Checked ? 1 : 0), txtCode.Text, txtFactoryCode.Text, txtCitrixConfig.Text, txtZEUSOs.Text, txtZEUSOsVersion.Text, txtZEUSBuildType.Text, txtZEUSBuildTypePNC.Text, txtVMware.Text, txtBootEnvironment.Text, txtTaskSequence.Text, txtAltiris.Text, (chkLinux.Checked ? 1 : 0), (chkAix.Checked ? 1 : 0), (chkSolaris.Checked ? 1 : 0), (chkWindows.Checked ? 1 : 0), (chkWindows2008.Checked ? 1 : 0), (radRDPAltiris.Checked ? 1 : 0), (radRDPMDT.Checked ? 1 : 0), (chkE1000.Checked ? 1 : 0), (chkManualBuild.Checked ? 1 : 0), Int32.Parse(ddlDefaultSP.SelectedItem.Value), (chkStandard.Checked ? 1 : 0), (oOperatingSystems.Gets(0).Tables[0].Rows.Count + 1), (chkEnabled.Checked ? 1 : 0)); } else { oOperatingSystems.Update(Int32.Parse(Request.Form[hdnId.UniqueID]), txtName.Text, (chkCluster.Checked ? 1 : 0), (chkWorkstation.Checked ? 1 : 0), txtCode.Text, txtFactoryCode.Text, txtCitrixConfig.Text, txtZEUSOs.Text, txtZEUSOsVersion.Text, txtZEUSBuildType.Text, txtZEUSBuildTypePNC.Text, txtVMware.Text, txtBootEnvironment.Text, txtTaskSequence.Text, txtAltiris.Text, (chkLinux.Checked ? 1 : 0), (chkAix.Checked ? 1 : 0), (chkSolaris.Checked ? 1 : 0), (chkWindows.Checked ? 1 : 0), (chkWindows2008.Checked ? 1 : 0), (radRDPAltiris.Checked ? 1 : 0), (radRDPMDT.Checked ? 1 : 0), (chkE1000.Checked ? 1 : 0), (chkManualBuild.Checked ? 1 : 0), Int32.Parse(ddlDefaultSP.SelectedItem.Value), (chkStandard.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); oOperatingSystems.UpdateOrder(intId, intCount); } } Response.Redirect(Request.Path); }