Ejemplo n.º 1
0
        protected void btnAdd_Click(Object Sender, EventArgs e)
        {
            int intDomain = Int32.Parse(ddlDomain.SelectedItem.Value);

            if (Request.Form[hdnId.UniqueID] == "0")
            {
                oDomain.AddSuffix(intDomain, txtName.Text, (oDomain.GetSuffixs(intDomain, 0).Tables[0].Rows.Count + 1), (chkEnabled.Checked ? 1 : 0));
            }
            else
            {
                oDomain.UpdateSuffix(Int32.Parse(Request.Form[hdnId.UniqueID]), intDomain, txtName.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);
                    oDomain.UpdateSuffixOrder(intId, intCount);
                }
            }
            Response.Redirect(Request.Path);
        }