Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("đâs");
            txtTieuDe.Focus();

            if (Request.QueryString["id"] != null)
            {
                if (Session["mess"].ToString().Equals("suatourthanhcong"))
                {
                    Session["mess"] = "";
                    string myScript = "\n<script type=\"text/javascript\" language=\"Javascript\" id=\"EventScriptBlock\">\n";
                    myScript += "toastr.success(\"Sửa Tour Thành Công\",\"Thông Báo\");";
                    myScript += "\n\n </script>";
                    //Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", myScript, false);
                    notification.InnerHtml = myScript;
                }
                // System.Diagnostics.Debug.WriteLine("id khong null");
                if (!IsPostBack)
                {
                    xemTour(Request.QueryString["id"]);
                    danhSachThoiGianKhoiHanh(Convert.ToInt32(Request.QueryString["id"]));
                    layNhomTour();
                }


                //xemTour(Request.QueryString["id"].ToString());
            }
            else
            {
                if (Request.QueryString["tg"] != null && !IsPostBack)
                //if(1==0)
                {
                    // Debug.WriteLine("tg != null");
                    tourController.upDateTrangThaiThoiGian(Convert.ToInt32(Request.QueryString["tg"]));
                    //tourController.upDateTrangThaiThoiGian(1);
                    // tourModel.upDateTrangThaiThoiGian(1);
                    //  Debug.WriteLine(tourController.update(1));
                    Response.Redirect("../suaTour.aspx?id=" + Request.QueryString["tour"]);
                }
                else
                {
                    Response.Redirect("suaTour.aspx?id=18");
                }
            }
        }
Esempio n. 2
0
        public static String cntttg(string id, string idtour)
        {
            Debug.WriteLine("id ajax : " + id);
            TourController tourController1 = new TourController();

            try
            {
                if (tourController1.upDateTrangThaiThoiGian(Convert.ToInt32(id)))
                {
                    DataTable table = tourController1.dsThoiGianKhoiHanh(Convert.ToInt32(idtour));
                    //  Debug.WriteLine(JsonConvert.SerializeObject(table));
                    return(JsonConvert.SerializeObject(table));
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                return(null);
            }
        }