Example #1
0
        protected void btnAdd_Click(Object Sender, EventArgs e)
        {
            int intApp = Int32.Parse(Request.Form[hdnParent.UniqueID]);

            if (Request.Form[hdnId.UniqueID] == "0")
            {
                oRequestItem.AddItem(intApp, txtName.Text, txtServiceTitle.Text, txtImage.Text, Int32.Parse(ddlPlatform.SelectedItem.Value), (chkActivity.Checked ? 1 : 0), (chkShow.Checked ? 1 : 0), oRequestItem.GetItems(intApp, 0, 1).Tables[0].Rows.Count + 1, (chkEnabled.Checked ? 1 : 0));
            }
            else
            {
                oRequestItem.UpdateItem(Int32.Parse(Request.Form[hdnId.UniqueID]), intApp, txtName.Text, txtServiceTitle.Text, txtImage.Text, Int32.Parse(ddlPlatform.SelectedItem.Value), (chkActivity.Checked ? 1 : 0), (chkShow.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);
                    oRequestItem.UpdateItemOrder(intId, intCount);
                }
            }
            Response.Redirect(Request.Path);
        }