Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        TouristServices touristServices = null;

        AddAttributes();

        if (Request.QueryString["bid"] != null)
        {
            BookingId = Convert.ToInt32(Request.QueryString["bid"]);
        }
        if (Request.QueryString["tno"] != null)
        {
            TouristNo = Convert.ToInt32(Request.QueryString["tno"]);
        }

        SessionServices.TouristDetails_BookingNo = BookingId;

        if (SessionServices.TouristDetails_TouristNo > 0)
        {
            TouristNo       = SessionServices.TouristDetails_TouristNo;
            touristServices = new TouristServices();
            BookingTouristDTO oBTData = touristServices.GetBookingTouristDetails(BookingId, TouristNo);
            if (oBTData != null)
            {
                FillTouristDetails(oBTData);
            }
            touristServices = null;
            oBTData         = null;
            SessionServices.DeleteSession(Constants._TouristDetails_TouristNo);
        }
        if (!IsPostBack)
        {
            FillNationality();
            radEmpNo.Checked = true;
            if (Request.QueryString["op"] == "edit")
            {
                btnSaveTouristDetails.Text = "Update";
                if (touristServices == null)
                {
                    touristServices = new TouristServices();
                }
                BookingTouristDTO oBTData = touristServices.GetBookingTouristDetails(BookingId, TouristNo);
                if (oBTData != null)
                {
                    FillTouristDetails(oBTData);
                }
                touristServices = null;
                oBTData         = null;
            }
            else
            {
                btnDelete.Visible = false;
            }
            System.Web.UI.ScriptManager.GetCurrent(this).SetFocus(this.ddlSuffix);
        }
    }
Пример #2
0
 protected void GridRoomPaxDetail_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Edit")
     {
         if (Request.QueryString["bid"] != null)
         {
             BookingId = Convert.ToInt32(Request.QueryString["bid"]);
         }
         TouristNo = Convert.ToInt32(e.CommandArgument.ToString());
         Session["gettouristno"] = TouristNo;
         Session["getbookingid"] = BookingId;
         TouristServices touristServices = null;
         touristServices = new TouristServices();
         BookingTouristDTO oBTData = touristServices.GetBookingTouristDetails(BookingId, TouristNo);
         if (oBTData != null)
         {
             FillTouristDetails(oBTData);
         }
         SetDatatoObject();
         btnSubmit.Text  = "Update";
         touristServices = null;
         oBTData         = null;
     }
 }