Example #1
0
        protected void btnUpdate_Click(Object Sender, EventArgs e)
        {
            int intID = Int32.Parse(Request.QueryString["id"]);

            oWorkstation.UpdatePool(intID, txtName.Text, txtDescription.Text, Int32.Parse(Request.Form[hdnContact1.UniqueID]), Int32.Parse(Request.Form[hdnContact2.UniqueID]), intProfile, (chkEnabled.Checked ? 1 : 0));
            // Add workstations
            oWorkstation.DeletePoolWorkstations(intID);
            string strWorkstations = Request.Form[hdnWorkstations.UniqueID];

            while (strWorkstations != "")
            {
                string strField = strWorkstations.Substring(0, strWorkstations.IndexOf("&"));
                strWorkstations = strWorkstations.Substring(strWorkstations.IndexOf("&") + 1);
                int intOrder = Int32.Parse(strField.Substring(strField.IndexOf("_") + 1));
                strField = strField.Substring(0, strField.IndexOf("_"));
                oWorkstation.AddPoolWorkstation(intID, Int32.Parse(strField), intOrder, intProfile);
            }
            Response.Redirect(oPage.GetFullLink(intPage) + "?id=" + intID.ToString() + "&save=true");
        }