Пример #1
0
    //private int InsertBookingTableData()
    //{
    //    try
    //    {

    //        //  blsr._sBookingRef = txtBookRef.Text.Trim().ToString();
    //        blsr._dtStartDate = Convert.ToDateTime(txtChkin.Text.Trim());
    //        blsr._dtEndDate = Convert.ToDateTime(txtChkOut.Text.Trim());


    //        Int32.TryParse(Session["AcId"].ToString(), out iAccomId);
    //        Int32.TryParse(Session["AccomTypeId"].ToString(), out iaccomtypeid);
    //        Int32.TryParse(Session["Agid"].ToString(), out iagentid);
    //        blsr._iAccomTypeId = iaccomtypeid;
    //        blsr._iAccomId = iAccomId;
    //        blsr._iAgentId = iagentid;
    //        //Convert.ToInt32(Session["UserCode"].ToString());
    //        blsr._iNights = Convert.ToInt32((Convert.ToDateTime(txtChkOut.Text.Trim()) - Convert.ToDateTime(txtChkin.Text.Trim())).TotalDays);
    //        DataTable dtRoomBookingDetails = ViewState["VsRoomDetails"] as DataTable;
    //        blsr._iPersons = Convert.ToInt32(dtRoomBookingDetails.Compute("SUM(Pax)", string.Empty));
    //        blsr._BookingStatusId = 1;
    //        blsr._SeriesId = 0;
    //        blsr._proposedBooking = false;
    //        blsr._chartered = false;
    //        int GetQueryResponse = dlsr.AddParentBookingDetail(blsr);
    //        if (GetQueryResponse > 0)
    //            return 1;
    //        else
    //            return 0;
    //    }
    //    catch
    //    {
    //        return 0;
    //    }
    //}



    //private int InsertRoomBookingTableData()
    //{



    //    Int32.TryParse(Session["AcId"].ToString(), out iAccomId);
    //    blsr._iAccomId = iAccomId;

    //    blsr.action = "getMaxBookId";



    //    DataTable dtmaxId = dlsr.GetMaxBookingId(blsr);

    //    int MaxBookingId = Convert.ToInt32(dtmaxId.Rows[0].ItemArray[0].ToString());
    //    //  BookedId = MaxBookingId;
    //    blsr._iBookingId = MaxBookingId;
    //    int LoopInsertStatus = 0;
    //    try
    //    {

    //        for (int LoopCounter = 0; LoopCounter < gdvSelectedRooms.Rows.Count; LoopCounter++)
    //        {

    //            blsr._dtStartDate = Convert.ToDateTime(txtChkin.Text.Trim());
    //            blsr._dtEndDate = Convert.ToDateTime(txtChkOut.Text.Trim());
    //            blsr._iPaxStaying = Convert.ToInt32(gdvSelectedRooms.Rows[LoopCounter].Cells[3].Text);
    //            blsr._bConvertTo_Double_Twin = false;
    //            blsr._cRoomStatus = "B";
    //            HiddenField hfnrm = (HiddenField)gdvSelectedRooms.Rows[LoopCounter].FindControl("hdnRmno");


    //            blsr._sRoomNo = hfnrm.Value.ToString();
    //            //   blsr.action = "AddPriceDetailsToo";
    //            blsr._Amt = Convert.ToDecimal(gdvSelectedRooms.Rows[LoopCounter].Cells[4].Text);

    //            int GetQueryResponse = dlsr.AddRoomBookingDetails(blsr);
    //            if (GetQueryResponse > 0)
    //                LoopInsertStatus++;
    //            else
    //            {
    //                //do nothing
    //            }


    //        }
    //        //   insertbookingMealData(MaxBookingId);
    //        if (LoopInsertStatus == gdvSelectedRooms.Rows.Count)
    //        {

    //            return 1;
    //        }
    //        else
    //            return
    //                0;



    //    }
    //    catch
    //    {
    //        return 0;
    //    }


    //}

    protected void Button2_Click(object sender, EventArgs e)
    {
        try
        {
            Session["HotelBokingUrl"] = Request.Url.ToString();


            Int32.TryParse(Session["AcId"].ToString(), out iAccomId);
            Int32.TryParse(Session["AccomTypeId"].ToString(), out iaccomtypeid);

            DataTable fg = ViewState["VsRoomDetails"] as DataTable;
            SessionServices.SaveSession <DataTable>("Bookingdt", fg);

            Session["Chkin"]  = Session["HCheckin"].ToString();
            Session["chkout"] = Session["HCheckout"].ToString();
            //   Session["BookRef"] = txtBookRef.Text.Trim();
            Session["AccomId"]      = iAccomId;
            Session["iAccomtypeId"] = iaccomtypeid;
            Session["AId"]          = Session["Agid"].ToString();
            if (Session["RedUrl"] == null)
            {
                string redurl = "AfterBookingDetails.aspx?AccomName=" + Request.QueryString["AccomName"].ToString() + "";
                Session["RedUrl"] = redurl;
            }

            Response.Redirect(Session["RedUrl"].ToString());
        }
        catch
        {
        }
    }
    public void calcamt(DataTable dts)
    {
        try
        {
            for (int j = 0; j < dts.Rows.Count; j++)
            {
                string[] arr = dts.Rows[j]["Total"].ToString().Split(' ');

                TotalPaybleAmt = TotalPaybleAmt + Convert.ToInt32(arr[1]);;
            }
            hdnfTotalPaybleAmt.Value = TotalPaybleAmt.ToString();

            txtPaidAmt.Text = Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("N2");
            Bookingdt       = SessionServices.RetrieveSession <DataTable>("Bookingdt");

            lbltotAmt.Text     = Bookingdt.Rows[0]["Currency"].ToString() + " " + TotalPaybleAmt.ToString();
            lblCurrency.Text   = Bookingdt.Rows[0]["Currency"].ToString().ToString() + " ";
            txtPaidAmt.Text    = Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("#.##");
            hftxtpaidamt.Value = Convert.ToDouble(txtPaidAmt.Text).ToString("N2").Replace(",", "");

            lblBalanceAmt.Text = Bookingdt.Rows[0]["Currency"].ToString().ToString() + " " + Math.Round((TotalPaybleAmt - Convert.ToDouble(txtPaidAmt.Text))).ToString();

            //   lbltotAmt.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + TotalPaybleAmt.ToString();
        }

        catch
        {
        }
    }
Пример #3
0
        private async void GoToHomePage(object sender, EventArgs args)
        {
            SessionServices sessionServices = new SessionServices();
            UserServices    userServices    = new UserServices();

            UserToLoginDto user = new UserToLoginDto()
            {
                Email    = email.Text,
                Password = password.Text
            };

            List <UserDto> u = await userServices.GetUserByEmailAsync(email.Text);

            register.IsEnabled = false;
            login.IsEnabled    = false;
            login.Text         = "Logging in...";
            string token = await sessionServices.CreateSessionAsync(user);

            if (token != "")
            {
                Application.Current.Properties["IdUser"] = u[0].ID;
                Application.Current.Properties["Token"]  = token;
                await Navigation.PushModalAsync(new MainPage(), true);
            }
            else
            {
                error.IsVisible    = true;
                register.IsEnabled = true;
                login.IsEnabled    = true;
                login.Text         = "Login";
            }
        }
Пример #4
0
        protected override void OnPreInit(EventArgs e)
        {
            if (AppServiceStartAction.state != DataBaseService.PingDbState.NoError)
            {
                SessionServices.StartSession(HttpContext.Current);
                return;
            }

            if (MobileHelper.IsMobileEnabled())
            {
                MasterPageFile = VirtualPathUtility.ToAbsolute(("~/Templates/Mobile/MasterPage.master"));
            }
            else
            {
                if (SettingsDesign.Template != TemplateService.DefaultTemplateId &&
                    File.Exists(Server.MapPath("~/Templates/" + SettingsDesign.Template + "/MasterPage.master")) &&
                    !Request.RawUrl.Contains("social") &&
                    MasterPageFile != null)
                {
                    MasterPageFile = VirtualPathUtility.ToAbsolute(("~/Templates/")) + SettingsDesign.Template +
                                     "/MasterPage.master";
                }
            }

            base.OnPreInit(e);
        }
        public void BindTheSesssionToTheCurrentSessionWhenOpeningASession()
        {
            var session = Isolate.Fake.Instance <ISession>();

            SessionServices.OpenSession();
            Isolate.Verify.WasCalledWithAnyArguments(() => CurrentSessionContext.Bind(session));
        }
Пример #6
0
 public HomeController(CookieServices _ICookieServices,
                       SessionUser _SessionUser,
                       SessionServices _SessionServices)
 {
     CookiesServices = _ICookieServices;
     SessionUser     = _SessionUser;
     SessionServices = _SessionServices;
 }
    protected void btnCustLogin_Click(object sender, EventArgs e)
    {
        try
        {
            blcus.Email    = txtCustMailId.Text.Trim();
            blcus.Password = txtCustPass.Text.Trim();
            blcus.action   = "LoginCust";

            DataTable dtCustomer = dlcus.checkDuplicateemail(blcus);
            if (dtCustomer != null)
            {
                if (dtCustomer.Rows.Count > 0)
                {
                    Session["CustMailId"] = txtCustMailId.Text.Trim();


                    ViewState["Pass"]      = txtCustPass.Text.Trim();
                    lblBillingAddress.Text = dtCustomer.Rows[0]["BillingAddress"].ToString();


                    lblAgentName.Text     = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString()) + " " + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString());
                    lbPaymentMethod.Text  = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["PaymentMethod"].ToString());
                    hdnfPhoneNumber.Value = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Telephone"].ToString());

                    Session["CustId"]       = dtCustomer.Rows[0]["CustId"].ToString();
                    Session["CustomerCode"] = dtCustomer.Rows[0]["CustId"].ToString();

                    Session.Add("CustomerMailId", DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Email"].ToString()));
                    Session.Add("CustPassword", DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Password"].ToString()));
                    DataTable dtrpax = SessionServices.RetrieveSession <DataTable>("Bookingdt");

                    string BookRef = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString()) + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString()) + "X" + Convert.ToDouble(dtrpax.Compute("SUM(Pax)", string.Empty)).ToString() + "-" + "Self";
                    ViewState["BookRef"] = BookRef;
                    lbPaymentMethod.Text = "N/A";


                    pnlFullDetails.Visible          = true;
                    panelwithoutCreditAgent.Visible = true;
                    pnlBookButton.Visible           = true;
                    customerLogin.Visible           = false;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Password or Email Id incorrect')", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Password or Email Id incorrect')", true);
            }
            //Bookingdt = Session["Bookingdt"] as DataTable;
            //  preparetables(Bookingdt);
        }
        catch
        {
        }
    }
        public void UseACachedConnectionWhenOpeningASession()
        {
            var conn = Isolate.Fake.Instance <IDbConnection>();

            ObjectFactory.Configure(x => x.For <IDbConnection>().HybridHttpOrThreadLocalScoped().Use(conn));

            SessionServices.OpenSession();
            Isolate.Verify.WasCalledWithExactArguments(() => _fact.OpenSession(conn));
        }
Пример #9
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);
        }
    }
Пример #10
0
 public static void SetLoggedUser(FomMonitoringCore.SqlServer.Users user)
 {
     if (UseCacheInsteadOfSession())
     {
         CacheService.SetValue("LoggedUser", user);
     }
     else
     {
         SessionServices.SetValue("LoggedUser", user);
     }
 }
Пример #11
0
 public static void ClearSession()
 {
     if (UseCacheInsteadOfSession())
     {
         CacheService.Clear();
     }
     else
     {
         SessionServices.Clear();
     }
 }
Пример #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Bookingdt = SessionServices.RetrieveSession <DataTable>("Bookingdt");
        gdvSelectedRooms.DataSource = Bookingdt;
        gdvSelectedRooms.DataBind();
        lblArrvDate.Text   = Session["Chkin"].ToString();
        lblDepartDate.Text = Session["chkout"].ToString();;
        lblacm.Text        = lblAccomName.Text = Session["AccomName"].ToString();

        CalcAmount();
        getbalance();
    }
    private int InsertBookingTableData(int acmid, int acmtpid, int agid, string bkref, DateTime cin, DateTime cout)
    {
        try
        {
            BALBooking blsr = new BALBooking();
            DALBooking dlsr = new DALBooking();

            DataTable dtbkdetails = SessionServices.RetrieveSession <DataTable>("Bookingdt");
            blsr._sBookingRef = bkref;
            blsr._dtStartDate = cin;
            blsr._dtEndDate   = cout;

            if (Session["CustId"] != null && Session["UserCode"] == null)
            {
                blsr.CustomerId = Session["CustId"].ToString();
            }
            else
            {
                blsr.CustomerId = "0";
            }

            blsr._iAccomTypeId = acmtpid;
            blsr._iAccomId     = acmid;
            blsr._iAgentId     = agid;

            blsr._iNights         = Convert.ToInt32((cout - cin).TotalDays);
            blsr._iPersons        = Convert.ToInt32(dtbkdetails.Compute("SUM(Pax)", string.Empty));
            blsr._BookingStatusId = 1;
            blsr._SeriesId        = 0;
            blsr._proposedBooking = false;
            blsr._chartered       = false;
            blsr._BookingStatusId = (int)BookingStatusTypes.BOOKED;
            blsr._proposedBooking = true;

            int bookingId = dlsr.AddParentBookingDetail(blsr);

            var bookingDetails = dlsr.GetBookingDetails(bookingId);
            if (bookingDetails != null)
            {
                blsr.BookingCode = bookingDetails.BookingCode;
            }
            blsr._iBookingId = bookingId;

            //Session["tblBookingBAL"] = blsr;
            SessionServices.SaveSession <BALBooking>("tblBookingBAL", blsr);
            return(bookingId);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #14
0
        protected override void OnInit(EventArgs e)
        {
            if (AppServiceStartAction.state != DataBaseService.PingDbState.NoError)
            {
                SessionServices.StartSession(HttpContext.Current);
                return;
            }

            base.OnInit(e);
            Secure.VerifySessionForErrors();
            Secure.VerifyAccessLevel();
            CommonHelper.DisableBrowserCache();
        }
Пример #15
0
 /*
  * protected void dgSeries_DeleteCommand(object source, DataGridCommandEventArgs e)
  * {
  *  int iSeriesId = Convert.ToInt32(dgSeries.DataKeys[e.Item.ItemIndex].ToString());
  *  clsSeriesManager oSeriesManager;
  *  oSeriesManager = new clsSeriesManager();
  *  oSeriesManager.DeleteSeries(iSeriesId);
  *  RefreshGrid();
  * }
  * protected void dgSeries_ItemCommand(object source, DataGridCommandEventArgs e)
  * {
  *  try
  *  {
  *      if (e.Item.ItemIndex >= 0)
  *      {
  *          int iSeriesId = Convert.ToInt32(dgSeries.DataKeys[e.Item.ItemIndex].ToString());
  *          if (string.Compare(e.CommandName.ToString(), "Edit", true) == 0)
  *              Response.Redirect("SeriesBooking.aspx?sid=" + iSeriesId.ToString());
  *      }
  *  }
  *  catch (Exception exp)
  *  {
  *      GF.LogError("ViewSeries.dgSeries_ItemCommand", exp.Message);
  *      return;
  *  }
  *
  * }
  */
 protected void btnShow_Click(object sender, EventArgs e)
 {
     SessionServices.DeleteSession(Constants._ViewBooking_BookingData);
     if (txtStartDate.Text != "")
     {
         SessionServices.ViewSeries_StartSeriesDate = Convert.ToDateTime(txtStartDate.Text.ToString());
     }
     if (ddlAccomName.SelectedIndex != 0)
     {
         SessionServices.ViewSeries_SelectedAccomodation = ddlAccomName.SelectedValue;
     }
     RefreshGrid();
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["UserCode"] != null || Session["CustomerCode"] != null)
            {
                if (Session["UserCode"] != null)
                {
                    BookRef.Style.Remove("display");
                    ReqBookRef.Enabled = true;
                }
                else
                {
                    BookRef.Style.Add("display", "None");
                    ReqBookRef.Enabled = false;
                }
                lnkLogout.Visible = true;
            }
            else
            {
                BookRef.Style.Add("display", "None");

                ReqBookRef.Enabled = false;
                lnkLogout.Visible  = false;
            }
            this.pnlLogin.Visible           = false;
            this.pnlFullDetails.Visible     = false;
            pnlBookButton.Visible           = false;
            panelwithoutCreditAgent.Visible = false;
            Bookingdt     = new DataTable();
            Bookingdt     = SessionServices.RetrieveSession <DataTable>("Bookingdt");
            bookingmealdt = new DataTable();
            bookingmealdt = SessionServices.RetrieveSession <DataTable>("BookinMealdt");
            gdvSelectedRooms.DataSource = Bookingdt;
            gdvSelectedRooms.DataBind();

            //lblChkin.Text = Session["Chkin"].ToString();
            //lblChkout.Text = Session["chkout"].ToString();

            calcamt(Bookingdt);
            LoadCountries();

            pnlCustReg.Visible    = false;
            customerLogin.Visible = false;
        }

        Bookingdt = SessionServices.RetrieveSession <DataTable>("Bookingdt");
        preparetables(Bookingdt);
    }
    public void calcamt(DataTable dts)
    {
        try
        {
            for (int j = 0; j < dts.Rows.Count; j++)
            {
                string[] arr = dts.Rows[j]["Total"].ToString().Split(' ');

                TotalPaybleAmt = TotalPaybleAmt + Convert.ToInt32(arr[1]);;
            }
            hdnfTotalPaybleAmt.Value = TotalPaybleAmt.ToString();

            Bookingdt        = SessionServices.RetrieveSession <DataTable>("Bookingdt");
            lbltotAmt.Text   = Bookingdt.Rows[0]["Currency"].ToString() + " " + TotalPaybleAmt.ToString();
            lblCurrency.Text = Bookingdt.Rows[0]["Currency"].ToString().ToString() + " ";

            DateTime checkInDate = Convert.ToDateTime(Session["Chkin"]);
            double   paidAmt     = 0;
            if (checkInDate.AddDays(-30) < System.DateTime.Now)
            {
                //txtPaidAmt.Text = Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("N2");
                txtPaidAmt.Text = Math.Round(((100 * TotalPaybleAmt) / 100)).ToString("#.##");
                paidAmt         = Math.Round(((100 * TotalPaybleAmt) / 100));
            }
            else
            {
                //txtPaidAmt.Text = Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("N2");
                txtPaidAmt.Text = Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("#.##") + " (25 % of total)";
                paidAmt         = Math.Round(((25 * TotalPaybleAmt) / 100));
            }

            hftxtpaidamt.Value = paidAmt.ToString("N2").Replace(",", "");
            double balanceAmt = Math.Round((TotalPaybleAmt - paidAmt));

            if (balanceAmt > 0)
            {
                lblBalanceAmt.Text = Bookingdt.Rows[0]["Currency"].ToString().ToString() + " " + balanceAmt.ToString() + " (75% of total) to be paid prior to " + checkInDate.AddDays(-30).ToString("MMM-dd-yyyy");
            }
            else
            {
                lblBalanceAmt.Text = Bookingdt.Rows[0]["Currency"].ToString().ToString() + " " + balanceAmt.ToString();
            }
            //   lbltotAmt.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + TotalPaybleAmt.ToString();
        }
        catch
        {
        }
    }
Пример #18
0
    private void InsertParentTableData()
    {
        try
        {
            if (Session["UserCode"] != null)
            {
                blsr._iAgentId = Convert.ToInt32(Session["UserCode"].ToString());
            }
            else
            {
                blsr._iAgentId = Convert.ToInt32(Session["CustId"].ToString());
            }


            blsr.action        = "GetDepartureDetails";
            blsr._iBookingId   = 0;
            blsr.PackageId     = Session["PackageId"].ToString();
            dtGetReturnedData  = dlsr.GetDepartureDetails(blsr);
            blsr._sBookingRef  = Session["BookingRef"].ToString();
            blsr._dtStartDate  = Convert.ToDateTime(dtGetReturnedData.Rows[0]["CheckInDate"]);
            blsr._dtEndDate    = Convert.ToDateTime(dtGetReturnedData.Rows[0]["CheckOutDate"]);
            blsr._iAccomTypeId = Convert.ToInt32(dtGetReturnedData.Rows[0]["AccomTypeId"]);
            blsr._iAccomId     = Convert.ToInt32(dtGetReturnedData.Rows[0]["AccomId"]);

            blsr._iNights = Convert.ToInt32(dtGetReturnedData.Rows[0]["NoOfNights"]);
            DataTable dtRoomBookingDetails = SessionServices.RetrieveSession <DataTable>("BookedRooms");
            blsr._iPersons        = Convert.ToInt32(dtRoomBookingDetails.Compute("SUM(Pax)", string.Empty));
            blsr._BookingStatusId = 1;
            blsr._SeriesId        = 0;
            blsr._proposedBooking = false;
            blsr._chartered       = false;
            Session.Add("tblBookingBAL", blsr);

            int iBRC = dlsr.GetBookingReferenceCount(blsr);

            if (iBRC > 0)
            {
                System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertBox", "alert('The Booking Reference mentioned by you is not unique. Please enter a different reference number.');", true);

                return;
            }

            int GetQueryResponse = dlsr.AddParentBookingDetail(blsr);
        }
        catch
        {
        }
    }
Пример #19
0
    private void bindRoomRates(int accmid, int Totpax, int agid, DateTime chkin, DateTime chkout, int norooms, int RtypeId)
    {
        try
        {
            if (Session["UserCode"] != null)
            {
                blht.action = "RoomRate";
            }
            else
            {
                blht.action = "RoomRateCust";
            }
            blht.Accomid      = accmid;
            blht.TotPax       = Totpax;
            blht.Reqnoofrooms = norooms;
            blht.checkin      = chkin;
            blht.Checkout     = chkout;
            blht.RoomTypeId   = RtypeId;

            blht.agentid = agid;
            Returndt     = dlht.GetHotelRates(blht);

            if (Returndt != null)
            {
                SessionServices.SaveSession <DataTable>("RoomInfo", Returndt);
                dv = new DataView(Returndt);
                //  dv.RowFilter = "ActualRoomTypeId<>0";

                if (dv.ToTable().Rows.Count > 0)
                {
                    gdvHotelRoomRates.DataSource = dv;
                    gdvHotelRoomRates.DataBind();
                    //avl.InnerHtml = "Available Rooms";
                }
                else
                {
                    //avl.InnerHtml = "No Rooms Available";
                    RemoveZeroes();
                }
                ViewState["Rrate"] = Returndt;
            }
        }
        catch
        {
        }
    }
Пример #20
0
    protected void btnDone_Click(object sender, EventArgs e)
    {
        if (!base.ValidateIfCommandAllowed(Request.Url.AbsoluteUri, ENums.PageCommand.Update))
        {
            return;
        }

        if (string.Compare(ddlTreeType.SelectedItem.Text, "Choose Tree Type", true) == 0)
        {
            return;
        }

        SetTreeTypeasDefault(GetSelectedTreeType());
        SessionServices.DeleteSession(Constants._BookingChart_TreeDTO);
        SessionServices.DeleteSession(Constants._BookingChart_TreeType);
        CloseWindow();
    }
Пример #21
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (AppServiceStartAction.state != DataBaseService.PingDbState.NoError)
            {
                SessionServices.StartSession(HttpContext.Current);
                return;
            }

            if (!File.Exists(SettingsGeneral.InstallFilePath))
            {
                Response.Redirect(UrlService.GetAbsoluteLink("install/default.aspx"));
            }

            AdvantShop.Helpers.BrowsersHelper.CheckSupportedBrowser();


            var  requestCookie = Request.Cookies[AntiXsrfTokenKey];
            Guid requestCookieGuidValue;

            if (requestCookie != null && Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))
            {
                // Use the Anti-XSRF token from the cookie
                _antiXsrfTokenValue   = requestCookie.Value;
                Page.ViewStateUserKey = _antiXsrfTokenValue;
            }
            else
            {
                // Generate a new Anti-XSRF token and save to the cookie
                _antiXsrfTokenValue   = Guid.NewGuid().ToString("N");
                Page.ViewStateUserKey = _antiXsrfTokenValue;

                var responseCookie = new HttpCookie(AntiXsrfTokenKey)
                {
                    HttpOnly = true,
                    Value    = _antiXsrfTokenValue
                };
                if (Request.IsSecureConnection)
                {
                    responseCookie.Secure = true;
                }
                Response.Cookies.Set(responseCookie);
            }
        }
Пример #22
0
 protected void btnShow_Click(object sender, EventArgs e)
 {
     SessionServices.DeleteSession(Constants._TouristCount_BookingData);
     if (txtStartDate.Text != "")
     {
         SessionServices.TouristCount_SelectedCheckInDate = txtStartDate.Text.ToString();
     }
     if (txtEndDate.Text != "")
     {
         SessionServices.TouristCount_SelectedCheckOutDate = txtEndDate.Text.ToString();
     }
     if (ddlAccomType.SelectedIndex != 0)
     {
         SessionServices.TouristCount_SelectedAccomodationType = ddlAccomType.SelectedValue;
     }
     //if (ddlBookingStatusTypes.SelectedIndex != 0)
     //SessionHandler.TouristCount_SelectedBookingStatus = ddlBookingStatusTypes.SelectedValue;
     RefreshGrid();
 }
Пример #23
0
    protected void gdvSelectedRooms_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            try
            {
                retdt = SessionServices.RetrieveSession <DataTable>("RoomInfo");
                Label roomcatid = (Label)e.Row.FindControl("lblRoomCatId");

                DataView dv = new DataView(retdt);
                dv.RowFilter        = "RoomCategoryId='" + roomcatid.Text + "' ";
                e.Row.Cells[7].Text = dv.ToTable().Rows[0]["TaxPct"].ToString();
                e.Row.Cells[8].Text = ((Convert.ToDouble(e.Row.Cells[7].Text) * Convert.ToDouble(e.Row.Cells[6].Text)) / 100).ToString();
            }
            catch
            {
            }
        }
    }
    private int InsertRoomBookingTableData(int bookingId, string bookingPaymentId)
    {
        try
        {
            BALBooking blsr = new BALBooking();
            DALBooking dlsr = new DALBooking();

            DataTable  dtbkdetails = SessionServices.RetrieveSession <DataTable>("Bookingdt");
            BALBooking booking     = dlsr.GetBookingDetails(bookingId);

            Session["maxBookId"] = bookingId;

            blsr._iBookingId = bookingId;
            blsr._iAccomId   = booking._iAccomId;
            blsr.PaymentId   = bookingPaymentId;

            //int LoopInsertStatus = 0;
            for (int LoopCounter = 0; LoopCounter < dtbkdetails.Rows.Count; LoopCounter++)
            {
                blsr._dtStartDate            = booking._dtStartDate;
                blsr._dtEndDate              = booking._dtEndDate;
                blsr._iPaxStaying            = booking._iPaxStaying;
                blsr._bConvertTo_Double_Twin = Convert.ToBoolean(dtbkdetails.Rows[LoopCounter]["ConvDouble"].ToString());
                blsr._cRoomStatus            = "B";

                blsr._sRoomNo    = dtbkdetails.Rows[LoopCounter][7].ToString();
                blsr._PaidAmount = Convert.ToDouble(Session["Paid"]);

                blsr.action = "AddPriceDetailsToo";
                string[] arr = dtbkdetails.Rows[LoopCounter]["Total"].ToString().Split(' ');
                blsr._Amt = Convert.ToDecimal(arr[1]);

                int GetQueryResponse = dlsr.AddRoomBookingDetails(blsr);
            }
            return(1);
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('" + ex.Message.ToString() + "')", true);
            throw ex;
        }
    }
Пример #25
0
    private int InsertBookingTableData(int acmid, int acmtpid, int agid, string bkref, DateTime cin, DateTime cout, DataTable vsdetails)
    {
        try
        {
            dtbkdetails = SessionServices.RetrieveSession <DataTable>("Bookingdt");

            blsr._sBookingRef = bkref;
            blsr._dtStartDate = cin;
            blsr._dtEndDate   = cout;


            blsr._iAccomTypeId = acmtpid;
            blsr._iAccomId     = acmid;
            blsr._iAgentId     = agid;

            blsr._iNights = Convert.ToInt32((cout - cin).TotalDays);

            blsr._iPersons        = Convert.ToInt32(dtbkdetails.Compute("SUM(Pax)", string.Empty));
            blsr._BookingStatusId = 1;
            blsr._SeriesId        = 0;
            blsr._proposedBooking = false;
            blsr._chartered       = false;



            int GetQueryResponse = dlsr.AddParentBookingDetail(blsr);
            if (GetQueryResponse > 0)
            {
                return(1);
            }

            else
            {
                return(0);
            }
        }
        catch (Exception ex)
        {
            return(0);
        }
    }
    private void LoadBookedRoomDetails()
    {
        dtGetBookedRooms = SessionServices.RetrieveSession<DataTable>("BookedRooms");
        DataTable dtgroupedData = new DataTable();
        dtgroupedData.Columns.Add("categoryName");
        dtgroupedData.Columns.Add("Pax");
        dtgroupedData.Columns.Add("Price");
        DataTable dtUniqueCategories = dtGetBookedRooms.DefaultView.ToTable(true, "categoryName");

        #region Adding distict Room categories
        foreach (DataRow dr1 in dtUniqueCategories.Rows)
        {
            string categoryName = dr1["categoryName"].ToString();
            DataRow dr2 = dtgroupedData.NewRow();
            dr2["categoryName"] = categoryName;
            dtgroupedData.Rows.Add(dr2);
        }
        #endregion

        #region calculating values
        foreach (DataRow dr1 in dtgroupedData.Rows)
        {
            string category = dr1["categoryName"].ToString();
            DataView dv;
            dv = new DataView(dtGetBookedRooms, "categoryName='" + category + "'", "categoryName", DataViewRowState.CurrentRows);
            DataTable dtFiltered = dv.ToTable();
            int packs = 0;
            decimal price = 0;
            foreach (DataRow dr3 in dtFiltered.Rows)
            {
                packs = packs + Convert.ToInt32(dr3["Pax"].ToString());
                price = price + Convert.ToDecimal(dr3["Price"].ToString());
            }
            dr1["Pax"] = packs.ToString();


            dr1["Price"] = price.ToString();
        }
        dtGetBookedRooms = dtgroupedData;
        #endregion
    }
Пример #27
0
        public AuthTicketDTO GetAuthDTO(string userName)
        {
            AuthTicketDTO AuthTicket = SessionServices.GetAuthTicket(userName);

            if (AuthTicket != null)
            {
                return(AuthTicket);
            }

            bool IsArabic = CultureInfo.CurrentCulture.IsArabic();
            User AuthUser = _users.GetAll(false, "UserRoles").Where(x => x.Username.ToUpper() == userName.ToUpper()).FirstOrDefault();

            if (AuthUser != null)
            {
                if (!AuthUser.Enabled)
                {
                    throw new BusinessException(_StringLocalizer.GetString("AccountIsDisabled"));
                }

                if (!AuthUser.IsApproved)
                {
                    throw new BusinessException(_StringLocalizer.GetString("AccountIsNotApproved"));
                }

                AuthTicketDTO Result = new AuthTicketDTO()
                {
                    Email          = AuthUser.Email,
                    FullName       = AuthUser.FullName,
                    UserName       = AuthUser.Username,
                    UserId         = AuthUser.UserId,
                    DefaultCulture = AuthUser.DefaultCulture,
                    RoleId         = AuthUser.UserRoles.FirstOrDefault()?.RoleId,
                    RoleName       = AuthUser.UserRoles.FirstOrDefault()?.Role.RoleName,
                };

                //Using Sessions Cache to Save AuthTicket
                SessionServices.SetAuthTicket(Result.UserName, Result);
                return(Result);
            }
            return(null);
        }
Пример #28
0
 private void GridRefresh()
 {
     SessionServices.DeleteSession(Constants._ViewBooking_BookingData);
     if (txtStartDate.Text != "")
     {
         SessionServices.ViewBooking_SelectedCheckInDate = txtStartDate.Text.ToString();
     }
     if (txtEndDate.Text != "")
     {
         SessionServices.ViewBooking_SelectedCheckOutDate = txtEndDate.Text.ToString();
     }
     if (ddlAccomType.SelectedIndex != 0)
     {
         SessionServices.ViewBooking_SelectedAccomodationType = ddlAccomType.SelectedValue;
     }
     if (ddlBookingStatusTypes.SelectedIndex != 0)
     {
         SessionServices.ViewBooking_SelectedBookingStatus = ddlBookingStatusTypes.SelectedValue;
     }
     RefreshGrid();
 }
    private void LoadBookedRoomDetails()
    {
        try
        {
            dtGetBookedRooms = SessionServices.RetrieveSession <DataTable>("BookedRooms");
            DataTable dtgroupedData = new DataTable();
            dtgroupedData.Columns.Add("categoryName");
            dtgroupedData.Columns.Add("Pax");
            dtgroupedData.Columns.Add("Price");
            dtgroupedData.Columns.Add("Currency");
            DataTable dtUniqueCategories = dtGetBookedRooms.DefaultView.ToTable(true, "categoryName");
            #region Adding distict Room categories
            foreach (DataRow dr1 in dtUniqueCategories.Rows)
            {
                string  categoryName = dr1["categoryName"].ToString();
                DataRow dr2          = dtgroupedData.NewRow();
                dr2["categoryName"] = categoryName;
                dtgroupedData.Rows.Add(dr2);
            }
            #endregion
            #region calculating values
            decimal TotalPaybleAmt = 0;
            double  gettax1        = 0;
            foreach (DataRow dr1 in dtgroupedData.Rows)
            {
                string   category = dr1["categoryName"].ToString();
                DataView dv;
                dv = new DataView(dtGetBookedRooms, "categoryName='" + category + "'", "categoryName", DataViewRowState.CurrentRows);
                DataTable dtFiltered     = dv.ToTable();
                int       packs          = 0;
                decimal   price          = 0;
                decimal   discountamount = 0;
                foreach (DataRow dr3 in dtFiltered.Rows)
                {
                    packs = packs + Convert.ToInt32(dr3["Pax"].ToString());
                    price = price + Convert.ToDecimal(dr3["Totalprice"].ToString().Replace(",", ""));
                }
                dr1["Pax"]      = packs.ToString();
                dr1["Price"]    = price.ToString();
                dr1["Currency"] = dv.ToTable().Rows[0]["Currency"].ToString();

                double discount = 0;
                if (Session["getdiscountvalue"] != null)
                {
                    try
                    {
                        discount = Convert.ToDouble(Session["getdiscountvalue"].ToString());
                    }
                    catch { }
                }
                lblDiscountper.Text = Session["getdiscountvalue"].ToString() + "%";
                TotalPaybleAmt      = TotalPaybleAmt + Convert.ToDecimal(price);
                try
                {
                    gettax1 = Convert.ToDouble(Session["gettax"].ToString().Split('R')[1]);
                }
                catch
                {
                    gettax1 = Convert.ToDouble(Session["gettax"].ToString());
                }
            }
            double total         = 0;
            double gettax        = 0;
            double getalltotal   = 0;
            double totyadiscount = 0;
            double grosstotal    = 0;
            double taxableamt    = 0;
            for (int i = 0; i < dtGetBookedRooms.Rows.Count; i++)
            {
                taxableamt    = taxableamt + Convert.ToDouble(dtGetBookedRooms.Rows[i]["taxablepamt"].ToString());
                gettax        = gettax + (Convert.ToDouble(dtGetBookedRooms.Rows[i]["Tax1"].ToString()));
                total         = Convert.ToDouble(total) + (Convert.ToDouble(dtGetBookedRooms.Rows[i]["pricewithouttax"].ToString().Replace(",", "")) * Convert.ToDouble(dtGetBookedRooms.Rows[i]["Pax"].ToString()));
                getalltotal   = Convert.ToDouble(getalltotal) + (Convert.ToDouble(dtGetBookedRooms.Rows[i]["CRPrice"].ToString().Split('R')[1].ToString().Replace(",", "")));
                totyadiscount = Convert.ToDouble(totyadiscount) + (Convert.ToDouble(dtGetBookedRooms.Rows[i]["Discountprice"].ToString().Replace(",", "")));
                grosstotal    = Convert.ToDouble(grosstotal) + (Convert.ToDouble(dtGetBookedRooms.Rows[i]["Totalprice"].ToString().Replace(",", "")));
            }
            Session["getcruisetax"]     = "INR" + ((Convert.ToDouble(dtGetBookedRooms.Rows[0]["pricewithouttax"].ToString()) * gettax1) / 100).ToString("##,0");
            lblTax.Text                 = "INR " + Convert.ToDouble(gettax.ToString()).ToString("##,0");
            Session["getcruiseinvoice"] = "INR " + Math.Round(gettax).ToString();
            lbltaxin.Text               = "INR " + taxableamt.ToString("##,0");
            if (lblDiscountper.Text != "0%")
            {
                lblDiscount.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + totyadiscount.ToString("##,0");
            }
            else
            {
                getdiscount.Visible = false;
            }
            lblalltotal.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + getalltotal.ToString("##,0");
            lbltotAmt.Text   = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + total.ToString("##,0");
            lblGross.Text    = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + Convert.ToDouble(grosstotal.ToString()).ToString("##,0");
            lblCurrency.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " ";
            if (Session["advanceamount"].ToString() == "")
            {
                txtPaidAmt.Text       = Convert.ToDouble(Math.Round(((100 * TotalPaybleAmt) / 100)).ToString("#.##")).ToString("##,0");
                lbl25.Text            = "";
                lblBalancedate.Text   = "N/A";
                trbalancedate.Visible = false;
            }
            else
            {
                txtPaidAmt.Text = Convert.ToDouble(Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("#.##")).ToString("##,0");
                if (Session["Getcheckindate"] != null)
                {
                    lblBalancedate.Text = "(75% of total) to be paid prior to " + Convert.ToDateTime(Session["Getcheckindate"].ToString()).AddDays(-90).ToString("dddd, MMMM d, yyyy");
                }
                lbl25.Text         = "(25% of Total)";
                Session["get25"]   = 1;
                Session["getPaid"] = txtPaidAmt.Text;
            }

            lblBalanceAmt.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + Convert.ToDouble(Math.Round((TotalPaybleAmt - Convert.ToDecimal(txtPaidAmt.Text))).ToString()).ToString("##,0");
            if (lblBalanceAmt.Text == "INR 0")
            {
                trbalanceamount.Visible = false;
            }
            Session["getbalanceSummerlizede"] = Math.Round((TotalPaybleAmt - Convert.ToDecimal(txtPaidAmt.Text))).ToString();
            dtGetBookedRooms = dtgroupedData;
            #endregion
        }
        catch (Exception ex)
        {
        }
    }
    private void loadall()
    {
        if (Session["UserCode"] != null)
        {
            try
            {
                blagentpayment._Action = "MailValidate";
                if (Session["AgentMailId"] != null && Session["Password"] != null)
                {
                    blagentpayment._EmailId  = Session["AgentMailId"].ToString();
                    blagentpayment._Password = Session["Password"].ToString();

                    DataTable dtAgent = dlagentpayment.BindControls(blagentpayment);
                    if (dtAgent.Rows.Count > 0)
                    {
                        lblAgentName.Text      = Session["UserName"].ToString();
                        lblBillingAddress.Text = dtAgent.Rows[0]["BillingAddress"].ToString();
                        lbPaymentMethod.Text   = dtAgent.Rows[0]["PaymentMethod"].ToString();
                        hdnfPhoneNumber.Value  = dtAgent.Rows[0]["Phone"].ToString();
                        hdnfCreditLimit.Value  = dtAgent.Rows[0]["CreditLimit"].ToString();
                        bool oncredit = Convert.ToBoolean(dtAgent.Rows[0]["ChkCredit"].ToString());
                        pnlFullDetails.Visible = true;
                        if (oncredit)
                        {
                            panelwithoutCreditAgent.Visible = false;
                            panelwithoutCreditAgent.Visible = true;
                        }
                        else
                        {
                            panelwithoutCreditAgent.Visible = true;
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Agent Payment Details Not found')", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('It seems you are not logged in')", true);
                }
            }
            catch (Exception sqe)
            {
            }
        }
        else if (Session["CustomerCode"] != null)
        {
            try
            {
                DataTable dtCustomer = new DataTable();
                blcus.Email = Session["CustMailId"].ToString();

                if (Session["guest"] != null)
                {
                    blcus.action = "getforguest";
                    dtCustomer   = dlcus.getforguest(blcus);
                }
                else
                {
                    blcus.Password          = Session["userpass"].ToString();
                    Session["CustPassword"] = Session["userpass"].ToString();
                    blcus.action            = "LoginCust";
                    dtCustomer = dlcus.checkDuplicateemail(blcus);
                }

                if (dtCustomer != null && dtCustomer.Rows.Count > 0)
                {
                    Session["CustomerMailId"] = Session["CustMailId"].ToString();
                    lblAgentName.Text         = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString()) + " " + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString());
                    lblBillingAddress.Text    = dlcus.GetBillingAddress(dtCustomer.Rows[0]);
                    lbPaymentMethod.Text      = dtCustomer.Rows[0]["PaymentMethod"].ToString();
                    hdnfPhoneNumber.Value     = dtCustomer.Rows[0]["Telephone"].ToString();
                    Session["CustId"]         = dtCustomer.Rows[0]["CustId"].ToString();
                    DataTable dtrpax  = SessionServices.RetrieveSession <DataTable>("BookedRooms");
                    string    BookRef = dtCustomer.Rows[0]["FirstName"].ToString() + dtCustomer.Rows[0]["LastName"].ToString() + "X" + Convert.ToDouble(dtrpax.Compute("SUM(Pax)", string.Empty)).ToString() + "-" + "Direct Client";
                    ViewState["BookRef"]            = BookRef;
                    lbPaymentMethod.Text            = "Online";
                    pnlFullDetails.Visible          = true;
                    panelwithoutCreditAgent.Visible = true;
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }