Example #1
0
        public void btnAdd_Click(Object Sender, EventArgs e)
        {
            if (txtCategory.Text == "")
            {
                txtCategory.Text = "News";
            }

            if (lngID == 0)
            {
                oWhatsNew.Add(txtTitle.Text, txtDescription.Text, txtAttachment.Text, txtVersion.Text, txtCategory.Text, intProfile, (chkEnabled.Checked ? 1 : 0));
            }
            else
            {
                oWhatsNew.Update(lngID, txtTitle.Text, txtDescription.Text, txtAttachment.Text, txtVersion.Text, txtCategory.Text, intProfile, (chkEnabled.Checked ? 1 : 0));
            }
            if (Request.Form[hdnOrder.UniqueID] != "")
            {
                string strOrder = Request.Form[hdnOrder.UniqueID];
                long   lngCount = 0;
                while (strOrder != "")
                {
                    lngCount++;
                    long lngID1 = Int32.Parse(strOrder.Substring(0, strOrder.IndexOf("&")));
                    strOrder = strOrder.Substring(strOrder.IndexOf("&") + 1);
                    oWhatsNew.UpdateOrder(lngID1, lngCount);
                }
            }
            Response.Redirect(Request.Path);
        }