Example #1
0
        protected void btn_create_Click(object sender, EventArgs e)
        {
            Service1Client client = new DBServiceReference.Service1Client();

            if (Session["draft_edit"] != null)
            {
                var id = Session["draft_id"].ToString();
                client.DeleteTrail(id);
            }

            string   title       = tb_title.Text;
            var      month       = dd_month.SelectedValue;
            var      year        = tb_year.Text;
            var      datestr     = year + month;
            DateTime date        = Convert.ToDateTime(datestr);
            string   description = tb_description.Text;
            string   gem1        = lb_gem1_listing.Text;
            string   gem2        = lb_gem2_listing.Text;
            string   gem3        = lb_gem3_lisitng.Text;
            string   banner      = title;
            string   trailid     = month + year + "trail";
            string   status      = "upcoming";

            int result = client.CreateTrail(trailid, title, date, description, gem1, gem2, gem3, banner, status);

            Session["draft_edit"] = false;
            Session.Remove("draft_id");

            Response.Redirect("Staff_Ongoing_Trails.aspx");
        }