예제 #1
0
 public DataTable GetBookableRoomDetails(BALAgentRooms obj)
 {
     try
     {
         SqlConnection  cn = new SqlConnection(strCon);
         SqlDataAdapter da = new SqlDataAdapter();
         da.SelectCommand = new SqlCommand("[dbo].[sp_agentMaxRooms]", cn);
         da.SelectCommand.Parameters.Clear();
         da.SelectCommand.Parameters.AddWithValue("@Action", obj._Action);
         da.SelectCommand.Parameters.AddWithValue("@AgentId", obj._AgentId);
         da.SelectCommand.CommandType = CommandType.StoredProcedure;
         cn.Open();
         da.SelectCommand.ExecuteReader();
         DataTable dtReturnData = new DataTable();
         cn.Close();
         da.Fill(dtReturnData);
         if (dtReturnData != null && dtReturnData.Rows.Count > 0)
         {
             foreach (DataRow row in dtReturnData.Rows)
             {
                 row["AgentName"] = DataSecurityManager.Decrypt(row["AgentName"].ToString());
             }
             return(dtReturnData);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
    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 string GetBillingAddress(DataTable dataRow)

    {
        address1   = DataSecurityManager.Decrypt(dataRow.Rows[0]["Address1"].ToString());
        address2   = DataSecurityManager.Decrypt(dataRow.Rows[0]["Address2"].ToString());
        city       = DataSecurityManager.Decrypt(dataRow.Rows[0]["City"].ToString());
        state      = DataSecurityManager.Decrypt(dataRow.Rows[0]["State"].ToString());
        postalCode = DataSecurityManager.Decrypt(dataRow.Rows[0]["PostalCode"].ToString());

        return(string.Format("{0} {1}, {2} {3} {4}", address1, address2, city, state, postalCode));
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string t          = "VDIzaDQ1aXMxMjRJNTRz";
        string PassportNo = DataSecurityManager.Decrypt(t.ToString());

        if (Session["CustName"] != null)
        {
            //lblUsername.Text = "Hello " + Session["CustName"].ToString();
        }
        if (!IsPostBack)
        {
            LoadCountries();
        }
    }
        public BookingDTMail[] GetBookingDetailsmail(int bookingid)
        {
            BookingDTMail[] oBRD = null;
            DatabaseManager oDB  = null;

            try
            {
                oDB = new DatabaseManager();
                string sProcName = "BookingDetailsformail";
                oDB.DbCmd = oDB.GetStoredProcCommand(sProcName);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@bookingid", DbType.Int32, bookingid);
                DataSet dsBRD = null;
                dsBRD = oDB.ExecuteDataSet(oDB.DbCmd);
                oDB   = null;

                if (dsBRD != null)
                {
                    oBRD = new BookingDTMail[dsBRD.Tables[0].Rows.Count];
                    for (int i = 0; i < oBRD.Length; i++)
                    {
                        oBRD[i]               = new BookingDTMail();
                        oBRD[i].Bookingcode   = dsBRD.Tables[0].Rows[i][0].ToString();
                        oBRD[i].AgentName     = DataSecurityManager.Decrypt(dsBRD.Tables[0].Rows[i][1].ToString());
                        oBRD[i].RefAgentName  = DataSecurityManager.Decrypt(dsBRD.Tables[0].Rows[i][2].ToString());
                        oBRD[i].Accomodation  = Convert.ToString(dsBRD.Tables[0].Rows[i][3].ToString());
                        oBRD[i].checkin       = Convert.ToDateTime(dsBRD.Tables[0].Rows[i][4].ToString());
                        oBRD[i].checkout      = Convert.ToDateTime(dsBRD.Tables[0].Rows[i][5].ToString());
                        oBRD[i].bookingstatus = Convert.ToString(dsBRD.Tables[0].Rows[i][6].ToString());
                        oBRD[i].pax           = Convert.ToInt32(dsBRD.Tables[0].Rows[i][7].ToString());
                        oBRD[i].Nights        = Convert.ToInt32(dsBRD.Tables[0].Rows[i][8].ToString());
                        oBRD[i].Bookingref    = Convert.ToString(dsBRD.Tables[0].Rows[i][9].ToString());
                        oBRD[i].chartered     = Convert.ToBoolean((dsBRD.Tables[0].Rows[i][10] != null && dsBRD.Tables[0].Rows[i][10].ToString() != "")? dsBRD.Tables[0].Rows[i][10] : false);
                        oBRD[i].packagename   = Convert.ToString(dsBRD.Tables[0].Rows[i][11].ToString());
                    }
                    dsBRD = null;
                }
            }
            catch (Exception exp)
            {
                oDB = null;
                //    GF.LogError("clsBookingRoomReportsHandler.GetDetailedBookingDetails", exp.Message);
                return(null);
            }
            finally
            {
                oDB = null;
            }
            return(oBRD);
        }
예제 #6
0
    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        string       st = DataSecurityManager.Decrypt("VDIzaDQ1aXMxMjRJNTRzNTVNNjVpbDNxNDNGNVRpOXdoMHdnZGZnNDMzQzM0bDQ1U3RINTQ0aVNoNHM5U2YwbZa29muiOnz/yMzpkFm/2rcsgt8rk4zSTV0+MmcmpeZG");
        UserDTO      userDto;
        UserServices userServices;
        int          iLoginId;

        userDto      = new UserDTO();
        userServices = new UserServices();
        try
        {
            if (Login1.UserName.Trim().ToString() == "" || Login1.Password.Trim().ToString() == "")
            {
                e.Authenticated = false;
            }

            userDto.UserId   = Login1.UserName.Trim().ToString();
            userDto.Password = Login1.Password.Trim().ToString();
            iLoginId         = userServices.ValidateUser(userDto);
            if (iLoginId > 0)
            {
                Session["getadmin"]     = Login1.UserName.Trim().ToString();
                Session["iLoginId"]     = iLoginId;
                e.Authenticated         = true;
                SessionServices.LoginId = iLoginId;
            }
            else if (iLoginId <= 0)
            {
                iLoginId = 0;
                //SessionHandler"LoginId"] = 0;
                SessionServices.LoginId = iLoginId;
                e.Authenticated         = false;
            }
        }
        catch (Exception exp)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "errorMsg", "" + exp.Message + "');");
            //Console.Write(exp.Message);
        }
        finally
        {
            userServices = null;
            userDto      = null;
        }
    }
예제 #7
0
        public List <AgentMarket> BindControlsAgentmarket(BALLinks obj)
        {
            List <AgentMarket> agentMarkets = new List <AgentMarket>();

            try
            {
                SqlConnection cn = new SqlConnection(strCon);

                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = new SqlCommand("[dbo].[sp_Links]", cn);
                da.SelectCommand.Parameters.Clear();
                da.SelectCommand.Parameters.AddWithValue("@Action", obj._Action);
                da.SelectCommand.Parameters.AddWithValue("@marketid", obj._MarketId);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                cn.Open();
                da.SelectCommand.ExecuteReader();
                DataTable dtReturnData = new DataTable();
                cn.Close();
                da.Fill(dtReturnData);
                if (dtReturnData != null)
                {
                    List <Action> actions = new List <Action>();
                    foreach (DataRow row in dtReturnData.Rows)
                    {
                        AgentMarket am = new AgentMarket
                        {
                            AgentId = Convert.ToInt32(row[0].ToString()),
                            //AgentName = DataSecurityManager.Decrypt(row[1].ToString()),
                            cnt = Convert.ToBoolean(row[2].ToString())
                        };
                        actions.Add(new Action(() => am.AgentName = DataSecurityManager.Decrypt(Convert.ToString(row[1]))));
                        agentMarkets.Add(am);
                    }
                    ParallelOptions po = new ParallelOptions();
                    po.MaxDegreeOfParallelism = 100;

                    Parallel.Invoke(po, actions.ToArray());
                }
                return(agentMarkets);
            }
            catch (Exception)
            {
                return(null);
            }
        }
    private void loaddetails(int bookingid)
    {
        blbooking._iBookingId = Convert.ToInt32(bookingid);
        DataTable dt = dlbooking.paymentreminder(blbooking);

        if (dt != null && dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["Name"]      = DataSecurityManager.Decrypt(dt.Rows[i]["Name"].ToString());
                dt.Rows[i]["lastname"]  = DataSecurityManager.Decrypt(dt.Rows[i]["lastname"].ToString());
                dt.Rows[i]["Email"]     = DataSecurityManager.Decrypt(dt.Rows[i]["Email"].ToString());
                dt.Rows[i]["Telephone"] = DataSecurityManager.Decrypt(dt.Rows[i]["Telephone"].ToString());
            }
        }
        else
        {
            // ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Your final payment against this booking has been received. There is no outstanding.')", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Your final payment against this booking has been received. There is no outstanding.');window.location.href = 'searchproperty1.aspx';", true);

            //string jv = "alert('Your final payment against this booking has been received. There is no outstanding.');";
            //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "msg", jv, true);
            Response.Redirect("searchproperty1.aspx?ID=01");

            // Response.Redirect("searchproperty1.aspx");
        }
        lblAgentName.Text  = dt.Rows[0]["Name"].ToString() + " " + dt.Rows[0]["lastname"].ToString();
        Session["InvName"] = DataSecurityManager.Decrypt(dt.Rows[0]["Name"].ToString()) + " " + DataSecurityManager.Decrypt(dt.Rows[0]["lastname"].ToString());

        try
        {
            {
                lblBillingAddress.Text = dt.Rows[0]["BillingAddress"].ToString();
                Session["Address"]     = dt.Rows[0]["BillingAddress"].ToString();
            }
        }
        catch
        {
            lblBillingAddress.Text = GetBillingAddress(dt);
            Session["Address"]     = GetBillingAddress(dt);
        }
        calculate(dt);
        Session["getdata"] = dt;
    }
        private BookingTouristDTO[] FillTouristDetails(DataSet ds)
        {
            DataRow dr;

            BookingTouristDTO[] oBookingTouristDTO = null;
            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    oBookingTouristDTO = new BookingTouristDTO[ds.Tables[0].Rows.Count];
                    #region AssigningValues
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        dr = ds.Tables[0].Rows[i];
                        oBookingTouristDTO[i] = new BookingTouristDTO();
                        if (dr.ItemArray.GetValue(0) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].TouristNo = Convert.ToInt32(dr.ItemArray.GetValue(0));
                        }
                        if (dr.ItemArray.GetValue(1) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].FirstName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(1)));
                        }
                        if (dr.ItemArray.GetValue(2) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].LastName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(2)));
                        }
                        if (dr.ItemArray.GetValue(3) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].PassportNo = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(3)));
                        }
                        if (dr.ItemArray.GetValue(4) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].Nationality = Convert.ToString(dr.ItemArray.GetValue(4));
                        }
                    }
                    #endregion AssigningValues
                }
            }

            return(oBookingTouristDTO);
        }
예제 #10
0
        public AgentDTO AgentLoginForTouristEntry(BALLogin obj)
        {
            try
            {
                SqlConnection cn    = new SqlConnection(strCon);
                string        query = "select a.AgentId, AgentCode, AgentName, AgentEmailId, Password from tblAgentMaster a  inner join tblBooking b on b.AgentId=a.AgentId where BookingID=" + obj.BookingId + " and AgentEmailId='" + DataSecurityManager.Encrypt(obj.EmailId) + "' and [password]='" + DataSecurityManager.Encrypt(obj.Password) + "'";

                SqlCommand cmd = new SqlCommand();
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = query;
                cmd.Connection  = cn;
                cn.Open();

                AgentDTO      agent  = null;
                SqlDataReader reader = cmd.ExecuteReader();

                DataTable dt = new DataTable();
                dt.Load(reader);

                if (dt != null && dt.Rows.Count > 0)
                {
                    agent         = new AgentDTO();
                    agent.AgentId = dt.Rows[0]["AgentId"] != null?Convert.ToInt32(dt.Rows[0]["AgentId"]) : -1;

                    agent.AgentCode = dt.Rows[0]["AgentCode"] != null ? dt.Rows[0]["AgentCode"].ToString() : string.Empty;
                    agent.AgentName = dt.Rows[0]["AgentName"] != null?DataSecurityManager.Decrypt(dt.Rows[0]["AgentName"].ToString()) : string.Empty;

                    agent.EmailId = dt.Rows[0]["AgentEmailId"] != null?DataSecurityManager.Decrypt(dt.Rows[0]["AgentEmailId"].ToString()) : string.Empty;

                    agent.Password = dt.Rows[0]["Password"] != null?DataSecurityManager.Decrypt(dt.Rows[0]["Password"].ToString()) : string.Empty;
                }
                reader.Close();
                cn.Close();

                return(agent);
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
예제 #11
0
        private UserDTO[] GetData(string sUserId)
        {
            UserDTO[] oUserData;
            oUserData = null;
            DataSet ds;
            string  query = "select UserId, UserName, Password, Active, Administrator, UserRoleId, userEmailId from tbluserMaster where 1=1";

            if (sUserId.Trim() != "")
            {
                query += " and UserId='" + sUserId + "'";
                query += " order by UserId";
            }
            ds = GetDataFromDB(query);
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                oUserData = new UserDTO[ds.Tables[0].Rows.Count];
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    oUserData[i]               = new UserDTO();
                    oUserData[i].UserId        = Convert.ToString(ds.Tables[0].Rows[i][0]);
                    oUserData[i].UserName      = DataSecurityManager.Decrypt(Convert.ToString(ds.Tables[0].Rows[i][1]));
                    oUserData[i].Password      = DataSecurityManager.Decrypt(Convert.ToString(ds.Tables[0].Rows[i][2]));
                    oUserData[i].Active        = Convert.ToBoolean(ds.Tables[0].Rows[i][3]);
                    oUserData[i].Administrator = Convert.ToBoolean(ds.Tables[0].Rows[i][4]);
                    oUserData[i].EmailId       = ds.Tables[0].Rows[i][6] != DBNull.Value ? DataSecurityManager.Decrypt(Convert.ToString(ds.Tables[0].Rows[i][6])) : String.Empty;

                    UserRoleDTO userRoleDto = new UserRoleDTO();
                    if (ds.Tables[0].Rows[i][5] != DBNull.Value)
                    {
                        userRoleDto = GetUserRoleDetails(Convert.ToInt32(ds.Tables[0].Rows[i][5]));
                    }

                    oUserData[i].UserRoleData       = userRoleDto;
                    oUserData[i].RoleIdForDisplay   = userRoleDto.UserRoleId;
                    oUserData[i].RoleNameForDisplay = userRoleDto.UserRoleName;
                }
            }
            return(oUserData);
        }
예제 #12
0
        private void btnDecryptText_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtEncryptedText.Text))
            {
                MessageBox.Show("Please enter the encrypted text to decrypt");
                return;
            }

            List <string> txtList = txtEncryptedText.Lines.ToList();

            StringBuilder sb = new StringBuilder();

            foreach (string encryptdText in txtList)
            {
                if (!string.IsNullOrWhiteSpace(encryptdText))
                {
                    sb.AppendLine(DataSecurityManager.Decrypt(encryptdText));
                }
            }
            txtResult.Text      = sb.ToString();
            lblTotalLength.Text = txtResult.Text.Length.ToString();
        }
예제 #13
0
    private void getbycustid(int custid)
    {
        balcustomer.action = "selectbyCustid";
        balcustomer.CustId = custid;
        DataTable dt = dalcustomer.selectbyCustid(balcustomer);

        if (dt != null && dt.Rows.Count > 0)
        {
            txtFisrtName.Text        = DataSecurityManager.Decrypt(dt.Rows[0]["FirstName"].ToString());
            txtLastName.Text         = DataSecurityManager.Decrypt(dt.Rows[0]["LastName"].ToString());
            txtEmail.Text            = DataSecurityManager.Decrypt(dt.Rows[0]["Email"].ToString());
            txtContactNo.Text        = DataSecurityManager.Decrypt(dt.Rows[0]["Telephone"].ToString());
            txtAddress1.Text         = DataSecurityManager.Decrypt(dt.Rows[0]["Address1"].ToString());
            txtAddress2.Text         = DataSecurityManager.Decrypt(dt.Rows[0]["Address2"].ToString());
            txtPost.Text             = DataSecurityManager.Decrypt(dt.Rows[0]["City"].ToString());
            txtState.Text            = DataSecurityManager.Decrypt(dt.Rows[0]["State"].ToString());
            txtCity.Text             = DataSecurityManager.Decrypt(dt.Rows[0]["City"].ToString());
            ddlCountry.SelectedValue = DataSecurityManager.Decrypt(dt.Rows[0]["CountryId"].ToString());
            ddlTitle.SelectedValue   = DataSecurityManager.Decrypt(dt.Rows[0]["Title"].ToString());
            //ddlTitle.Items.FindByText(dt.Rows[0]["Title"].ToString()).Selected = true;
            //ddlCountry.Items.FindByValue(dt.Rows[0]["CountryId"].ToString()).Selected = true;
        }
    }
예제 #14
0
        private void btnDecrypt_Click(object sender, EventArgs e)
        {
            List <UserMaster> userMasterDecryptedList = new List <UserMaster>();

            foreach (DataGridViewRow row in dgEncrypted.Rows)
            {
                UserMaster um = row.DataBoundItem as UserMaster;

                UserMaster num = new UserMaster
                {
                    Id            = um.Id,
                    UserId        = um.UserId,
                    UserName      = DataSecurityManager.Decrypt(um.UserName),
                    Password      = DataSecurityManager.Decrypt(um.Password),
                    userEmailId   = um.userEmailId,
                    Active        = um.Active,
                    Administrator = um.Administrator,
                    UserRoleId    = um.UserRoleId
                };
                userMasterDecryptedList.Add(num);
            }
            dgDecrypted.DataSource = userMasterDecryptedList;
        }
예제 #15
0
 protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
 {
     try
     {
         blcus.Email       = Login1.UserName.Trim().ToString();
         blcus.Password    = Login1.Password.Trim().ToString();
         blcus.action      = "LoginCust";
         dtGetReturnedData = new DataTable();
         dtGetReturnedData = dlcus.checkDuplicateemail(blcus);
         if (dtGetReturnedData != null)
         {
             Session.Add("CustName", DataSecurityManager.Decrypt(dtGetReturnedData.Rows[0]["FirstName"].ToString()));
             Session.Add("CustomerCode", dtGetReturnedData.Rows[0]["CustId"].ToString());
             Session.Add("CustomerMailId", DataSecurityManager.Decrypt(Login1.UserName.Trim().ToString()));
             Session.Add("CustPassword", DataSecurityManager.Decrypt(dtGetReturnedData.Rows[0]["Password"].ToString()));
             Response.Redirect("SearchProperty.aspx");
         }
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
예제 #16
0
        private RoomBookingDateWiseDTO[] MapDBToObject(DataSet dbData)
        {
            List <RoomBookingDateWiseDTO> dateWiseBookingDataList = new List <RoomBookingDateWiseDTO>();
            RoomBookingDateWiseDTO        dateWiseBookingDTO      = null;
            DataRow dr;

            try
            {
                if (dbData != null && dbData.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < dbData.Tables[0].Rows.Count; i++)
                    {
                        dr = dbData.Tables[0].Rows[i];
                        dateWiseBookingDTO = new RoomBookingDateWiseDTO();
                        if (dr.ItemArray.GetValue(0) != DBNull.Value)
                        {
                            dateWiseBookingDTO.AccomodationId = Convert.ToInt32(dr.ItemArray.GetValue(0));
                        }
                        if (dr.ItemArray.GetValue(1) != DBNull.Value)
                        {
                            dateWiseBookingDTO.RoomNo = Convert.ToString(dr.ItemArray.GetValue(1));
                        }
                        if (dr.ItemArray.GetValue(2) != DBNull.Value)
                        {
                            dateWiseBookingDTO.BookingId = Convert.ToInt32(dr.ItemArray.GetValue(2));
                        }
                        if (dr.ItemArray.GetValue(3) != DBNull.Value)
                        {
                            dateWiseBookingDTO.BookingCode = Convert.ToString(dr.ItemArray.GetValue(3)).Trim();
                        }
                        if (dr.ItemArray.GetValue(4) != DBNull.Value)
                        {
                            dateWiseBookingDTO.TourId = Convert.ToString(dr.ItemArray.GetValue(4));
                        }
                        if (dr.ItemArray.GetValue(5) != DBNull.Value)
                        {
                            dateWiseBookingDTO.Startdate = Convert.ToDateTime(dr.ItemArray.GetValue(5).ToString());
                        }
                        if (dr.ItemArray.GetValue(6) != DBNull.Value)
                        {
                            dateWiseBookingDTO.Enddate = Convert.ToDateTime(dr.ItemArray.GetValue(6).ToString());
                        }
                        if (dr.ItemArray.GetValue(7) != DBNull.Value)
                        {
                            dateWiseBookingDTO.Noofnights = Convert.ToInt32(dr.ItemArray.GetValue(7));
                        }
                        if (dr.ItemArray.GetValue(8) != null && dr.ItemArray.GetValue(8) != DBNull.Value)
                        {
                            dateWiseBookingDTO.BookingStatusId = Convert.ToInt32(dr.ItemArray.GetValue(8));
                        }
                        else
                        {
                            dateWiseBookingDTO.BookingStatusId = 0;
                        }
                        if (dr.ItemArray.GetValue(9) != null && dr.ItemArray.GetValue(9) != DBNull.Value)
                        {
                            dateWiseBookingDTO.AgentName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(9)));
                        }
                        if (dr.ItemArray.GetValue(15) != null && dr.ItemArray.GetValue(15) != DBNull.Value)
                        {
                            dateWiseBookingDTO.RefAgentName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(15)));
                        }
                        if (dr.ItemArray.GetValue(10) != null && dr.ItemArray.GetValue(10) != DBNull.Value)
                        {
                            dateWiseBookingDTO.BookingReference = Convert.ToString(dr.ItemArray.GetValue(10));
                        }
                        if (dr.ItemArray.GetValue(11) != null && dr.ItemArray.GetValue(11) != DBNull.Value)
                        {
                            dateWiseBookingDTO.BookingStatusType = Convert.ToString(dr.ItemArray.GetValue(11));
                        }

                        if (dr.ItemArray.GetValue(12) != null && dr.ItemArray.GetValue(12) != DBNull.Value)
                        {
                            dateWiseBookingDTO.Chartered = Convert.ToBoolean(dr.ItemArray.GetValue(12));
                        }
                        else
                        {
                            dateWiseBookingDTO.Chartered = false;
                        }

                        if (dr.ItemArray.GetValue(13) != null && dr.ItemArray.GetValue(13) != DBNull.Value)
                        {
                            dateWiseBookingDTO.NoofRooms = Convert.ToInt32(dr.ItemArray.GetValue(13));
                        }

                        if (dr.ItemArray.GetValue(14) != null && dr.ItemArray.GetValue(14) != DBNull.Value)
                        {
                            dateWiseBookingDTO.paxStaying = Convert.ToInt32(dr.ItemArray.GetValue(14));
                        }

                        dateWiseBookingDataList.Add(dateWiseBookingDTO);
                    }
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
            return(dateWiseBookingDataList.ToArray());
        }
예제 #17
0
        internal void DecryptData(List <ParentItem> items)
        {
            StringBuilder sb = new StringBuilder();

            List <string> updateQueryCollection = new List <string>();
            string        updateQuery           = string.Empty;

            List <string> columnNames = new List <string>();

            foreach (var parentItem in items)
            {
                string tableName = parentItem.ItemName;
                foreach (var childItem in parentItem.Children)
                {
                    string columnName = childItem.ItemName;
                    //if (childItem.Selected)
                    //{
                    //    ChangeColumnLength(tableName, columnName);
                    //}
                    columnNames.Add(columnName);
                }
                string query = "select " + string.Join(", ", columnNames) + " from " + tableName;

                List <ColumnDetail> columnDetails = new List <ColumnDetail>();

                var reader = GetData(query);
                while (reader.Read())
                {
                    columnDetails.Clear();

                    for (int i = 0; i < reader.FieldCount; i++)
                    {
                        ColumnDetail cd = new ColumnDetail();
                        cd.ColumnName = reader.GetName(i);
                        cd.ColumnType = reader.GetFieldType(i);
                        cd.Value      = reader.GetValue(i);
                        columnDetails.Add(cd);
                    }

                    #region Prepare the update part of the query
                    updateQuery = "update " + tableName + " set ";
                    foreach (var columnToBeEncrypted in parentItem.Children.Where(c => c.Selected))
                    {
                        ColumnDetail cd = columnDetails.FirstOrDefault(c => string.Compare(c.ColumnName, columnToBeEncrypted.ItemName, true) == 0);
                        updateQuery += columnToBeEncrypted.ItemName + " = '" + DataSecurityManager.Decrypt(cd.Value.ToString()).Replace("'", "''") + "', ";
                    }

                    if (updateQuery.Trim().EndsWith(","))
                    {
                        updateQuery = updateQuery.Trim().Substring(0, updateQuery.Trim().Length - 1);
                    }
                    #endregion


                    #region Prepare The Where Clause
                    updateQuery += " where 1 = 1 ";
                    foreach (var columnToBeEncrypted in parentItem.Children.Where(c => c.Selected))
                    {
                        var otherColumn = columnDetails.FirstOrDefault(c => string.Compare(c.ColumnName, columnToBeEncrypted.ItemName, true) == 0);

                        if (otherColumn == null)
                        {
                            continue;
                        }

                        string value = otherColumn.Value == DBNull.Value ? "NULL" : otherColumn.Value.ToString();
                        //Console.WriteLine(otherColumn.Value.ToString());

                        updateQuery += " and " + otherColumn.ColumnName + DecorateForSQlQuery(otherColumn.ColumnType, value);
                    }
                    #endregion

                    updateQuery += ";";

                    updateQueryCollection.Add(updateQuery);
                    sb.AppendLine(updateQuery);
                }
                reader.Close();
            }

            string qc = sb.ToString();

            foreach (var q in updateQueryCollection)
            {
                ExecuteNonQuery(q);
            }
        }
    protected void btnPayProceed_Click(object sender, EventArgs e)
    {
        try
        {
            Session["Hotel"] = 1;
            if (btnPayProceed.Text == "Proceed For Payment")
            {
                if (Session["UserCode"] != null)
                {
                    #region Book Via Agent
                    //[email protected] [1:48:55 PM] Augurs  Technologies Pvt. Ltd.: 12345

                    //DataTable dtrpax = Session["Bookingdt"] as DataTable;
                    string BookRef = txtBookRef.Text + "X" + GetPax().ToString();

                    Session.Add("BookingRef", BookRef);
                    Session["Paid"]          = Convert.ToDouble(hftxtpaidamt.Value.Trim() == "" ? "0" : hftxtpaidamt.Value.Trim());
                    blagentpayment._Action   = "MailValidate";
                    blagentpayment._EmailId  = Session["AgentMailId"].ToString();
                    blagentpayment._Password = Session["Password"].ToString();
                    var dtAgentData = dlagentpayment.BindControls(blagentpayment);

                    if (dtAgentData.Rows.Count <= 0)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Agent not registered!!!')", true);
                        return;
                    }

                    string BookingPayId = lbPaymentMethod.Text.Trim().Substring(0, 2) + DateTime.Now.ToString("MMddhhmmssfff");
                    Session["BookingPayId"] = BookingPayId;

                    BookTheHotel();

                    string Email          = Session["AgentMailId"].ToString();
                    string PhoneNumber    = "9999999999";            // hdnfPhoneNumber.Value.Trim().ToString();
                    string FirstName      = dtAgentData.Rows[0]["FirstName"] != DBNull.Value ? DataSecurityManager.Decrypt(dtAgentData.Rows[0]["FirstName"].ToString()) : "First Name";
                    string LastName       = "XYZ";                   //dtAgentData.Rows[0]["LastName"] != DBNull.Value ? DataSecurityManager.Decrypt(dtAgentData.Rows[0]["LastName"].ToString()) : "XYZ";
                    string PaidAmt        = hftxtpaidamt.Value.Trim().ToString();
                    string BillingAddress = "abc/wsdd,vasant vihar"; // lblBillingAddress.Text.Trim().ToString();

                    Session["Address"] = lblBillingAddress.Text.Trim().ToString();
                    Session["InvName"] = FirstName;

                    Session["SubInvName"] = FirstName;
                    string[] arr = { };
                    if (FirstName != "" && FirstName != null)
                    {
                        arr = FirstName.Split(' ');
                    }

                    if (Debugger.IsAttached)
                    {
                        RedirectToPaymentGatewayResponse();
                    }
                    else
                    {
                        //Response.Redirect("PaymentGatewayResponse.aspx?BookingPayId=" + PaymentId + "&EmailId=" + Email.ToString() + "&PhoneNumber=" + PhoneNumber.ToString() + "&FirstName=" + FirstName.ToString() + "&LastName=" + LastName.ToString() + "&PaidAmt=" + PaidAmt.ToString() + "&BillingAddress=" + BillingAddress.ToString());
                        //http://adventureresortscruises.in/Cruise/booking/sendtoairpay.aspx?BookedId=0&PackName=7N8D+Downstream+Cruise&NoOfNights=7&CheckinDate=12%2f4%2f2016&PackId=Pack4
                        Response.Redirect("~/Cruise/booking/sendtoairpay.aspx?BookingPayId=" + BookingPayId + "&EmailId=" + Email + "&PhoneNumber=" + PhoneNumber + "&FirstName=" + arr[0] + "&LastName=" + LastName + "&PaidAmt=" + PaidAmt.ToString() + "&BillingAddress=" + BillingAddress);
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('not registered!!!')", true);
                    }
                    #endregion
                }
                else
                {
                    #region Book Via Customer
                    Session.Add("BookingRef", ViewState["BookRef"].ToString());

                    blcus.Email    = DataSecurityManager.Decrypt(Session["CustomerMailId"].ToString());
                    blcus.Password = DataSecurityManager.Decrypt(Session["CustPassword"].ToString());

                    blcus.action = "LoginCust";
                    var dtCustomerData = new DataTable();
                    dtCustomerData  = dlcus.checkDuplicateemail(blcus);
                    Session["Paid"] = Convert.ToDouble(hftxtpaidamt.Value.Trim() == "" ? "0" : hftxtpaidamt.Value.Trim());

                    if (dtCustomerData.Rows.Count <= 0)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Customer not registered!!!')", true);
                        return;
                    }

                    int    persons    = GetPax();
                    string bookingRef = string.Format("{0} {1} X {2}",
                                                      DataSecurityManager.Decrypt(dtCustomerData.Rows[0]["FirstName"].ToString()),
                                                      DataSecurityManager.Decrypt(dtCustomerData.Rows[0]["LastName"].ToString()),
                                                      persons.ToString());

                    if (Session["BookingRef"] == null)
                    {
                        Session.Add("BookingRef", bookingRef);
                    }
                    else
                    {
                        Session["BookingRef"] = bookingRef;
                    }

                    Random rnd          = new Random();
                    string BookingPayId = rnd.Next(10000, 20000).ToString() + DateTime.Now.ToString("MMddhhmmssfff");
                    Session["BookingPayId"] = BookingPayId;

                    BookTheHotel();

                    string Email       = DataSecurityManager.Decrypt(Session["CustomerMailId"].ToString());
                    string PhoneNumber = "9999999999";// hdnfPhoneNumber.Value.Trim().ToString();
                    string FirstName   = DataSecurityManager.Decrypt(dtCustomerData.Rows[0]["FirstName"].ToString());
                    string LastName    = dtCustomerData.Rows[0]["LastName"] == DBNull.Value ? DataSecurityManager.Decrypt(dtCustomerData.Rows[0]["LastName"].ToString()) : "XYZ";

                    string PaidAmt        = hftxtpaidamt.Value.Trim().ToString();
                    string PaymentId      = BookingPayId.ToString();
                    string BillingAddress = "abc/wsdd,vasant vihar";// lblBillingAddress.Text.Trim().ToString();
                    Session["Address"]    = lblBillingAddress.Text.Trim().ToString();
                    Session["InvName"]    = DataSecurityManager.Decrypt(dtCustomerData.Rows[0]["Title"].ToString()) + " " + DataSecurityManager.Decrypt(dtCustomerData.Rows[0]["FirstName"].ToString()) + " " + DataSecurityManager.Decrypt(dtCustomerData.Rows[0]["LastName"].ToString());
                    Session["SubInvName"] = DataSecurityManager.Decrypt(dtCustomerData.Rows[0]["LastName"].ToString()) + ", " + DataSecurityManager.Decrypt(dtCustomerData.Rows[0]["Title"].ToString()) + " " + FirstName;

                    string[] arr = { };
                    if (FirstName != "" && FirstName != null)
                    {
                        arr = FirstName.Split(' ');
                    }

                    if (Debugger.IsAttached)
                    {
                        RedirectToPaymentGatewayResponse();
                    }
                    else
                    {
                        Response.Redirect("~/Cruise/booking/sendtoairpay.aspx?BookingPayId=" + PaymentId + "&EmailId=" + Email.ToString() + "&PhoneNumber=" + PhoneNumber.ToString() + "&FirstName=" + arr[0].ToString() + "&LastName=" + LastName.ToString() + "&PaidAmt=" + PaidAmt.ToString() + "&BillingAddress=" + BillingAddress.ToString());
                        //http://localhost:1897/ResortManager/Cruise/booking/SummerisedDetails.aspx?BookedId=0&PackName=Ganges+Exclusive&NoOfNights=5&CheckinDate=5%2f1%2f2016
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('not registered!!!')", true);
                    }
                    #endregion
                }
            }
            else
            {
                if (Convert.ToDecimal(hftxtpaidamt.Value) <= Convert.ToDecimal(hdnfCreditLimit.Value))
                {
                    string BookingPayId = lbPaymentMethod.Text.Trim().Substring(0, 2) + DateTime.Now.ToString("MMddhhmmssfff");
                    Session["BookingPayId"] = BookingPayId;
                    Session.Add("BookingRef", txtBookRef.Text.Trim().ToString());
                    Session["Paid"] = Convert.ToDouble(hftxtpaidamt.Value.Trim() == "" ? "0" : hftxtpaidamt.Value.Trim().ToString());

                    Session["InvName"] = DataSecurityManager.Decrypt(Session["UserName"].ToString());
                    Session["Address"] = null;
                    Response.Redirect("PaymentGatewayResponse.aspx");
                }
                else
                {
                    lblPaymentErr.Text = "Payment Amount Exceeding Credit Limit";
                }
            }
        }
        catch
        {
        }
    }
예제 #19
0
        private UserAgentMapperDTO GetAgents(String query)
        {
            UserAgentMapperDTO userAgentMapperDTO = new UserAgentMapperDTO();
            List <AgentDTO>    hookedAgentList    = new List <AgentDTO>();
            AgentDTO           hookedAgent        = new AgentDTO();
            DataSet            ds;

            ds = GetDataFromDB(query);
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    hookedAgent           = new AgentDTO();
                    hookedAgent.AgentId   = ds.Tables[0].Rows[i][1] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[i][1]);
                    hookedAgent.AgentName = ds.Tables[0].Rows[i][2] == DBNull.Value ? String.Empty : DataSecurityManager.Decrypt(Convert.ToString(ds.Tables[0].Rows[i][2]));
                    hookedAgentList.Add(hookedAgent);
                }
            }
            userAgentMapperDTO.AgentList = hookedAgentList;
            return(userAgentMapperDTO);
        }
예제 #20
0
    protected void btnCustLogin_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["bid"] != null)
        {
            try
            {
                string bid = Request.QueryString["bid"].ToString();
                blcus.Email    = txtCustMailId.Text.Trim();
                blcus.Password = txtCustPass.Text.Trim();

                blcus.action    = "LoginCustForTEntry";
                blcus.BookingId = Convert.ToInt32(bid);
                DataTable dtCustomer = dlcus.checkemailForTouristEntry(blcus);

                if (dtCustomer != null)
                {
                    if (dtCustomer.Rows.Count > 0)
                    {
                        Session["userpass"]     = txtCustPass.Text.Trim();
                        Session["CustMailId"]   = txtCustMailId.Text.Trim();
                        Session["CustName"]     = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString());
                        Session["CustomerCode"] = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["CustId"].ToString());
                        string bEmail    = dtCustomer.Rows[0][4].ToString();
                        string bPassword = dtCustomer.Rows[0][13].ToString();
                        string Email     = DataSecurityManager.Encrypt(txtCustMailId.Text.Trim());
                        string Password  = DataSecurityManager.Encrypt(txtCustPass.Text.Trim());
                        if (bEmail == Email)
                        {
                            if (bPassword == Password)
                            {
                                if (Request.QueryString["bid"] != null)
                                {
                                    Response.Redirect("http://test1.adventureresortscruises.in/Cruise/Booking/Touristentry.aspx?bid=" + bid);
                                }
                            }
                            else
                            {
                                ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Password  incorrect')", true);
                            }
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Email Id incorrect')", 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 (Exception ex)
            {
            }
        }
        else
        {
            if (Session["CustMailId"] != null)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('You are already login')", true);
                return;
            }
            else
            {
                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["userpass"]     = txtCustPass.Text.Trim();
                            Session["CustMailId"]   = txtCustMailId.Text.Trim();
                            Session["CustName"]     = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString());
                            Session["CustomerCode"] = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["CustId"].ToString());
                            if (Session["getavailable"] != null)
                            {
                                Response.Redirect(Session["getavailable"].ToString());
                            }
                            else
                            {
                                Response.Redirect("../Booking/searchproperty1.aspx");
                            }

                            //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 (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;
            }
        }
    }
예제 #22
0
        private BookingTouristDTO[] GetTouristsDetails(int BookingId, int TouristNo)
        {
            DataSet ds;
            DataRow dr;

            BookingTouristDTO[] oBookingTouristDTO;
            oBookingTouristDTO = null;

            string sProcName;

            try
            {
                oDB       = new DatabaseManager();
                sProcName = "up_Get_TouristDetails";
                oDB.DbCmd = oDB.GetStoredProcCommand(sProcName);

                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@BookingId", DbType.Int32, BookingId);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@TouristNo", DbType.Int32, TouristNo);

                ds  = oDB.ExecuteDataSet(oDB.DbCmd);
                oDB = null;
            }
            catch (Exception exp)
            {
                oDB = null;
                ds  = null;
                GF.LogError("clsBookingTouristhandler.GetTouristDetails", exp.Message);
            }

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    oBookingTouristDTO = new BookingTouristDTO[ds.Tables[0].Rows.Count];
                    #region AssigningValues
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        dr = ds.Tables[0].Rows[i];
                        oBookingTouristDTO[i]                     = new BookingTouristDTO();
                        oBookingTouristDTO[i].BookingId           = dr.ItemArray.GetValue(0) != DBNull.Value ? Convert.ToInt32(dr.ItemArray.GetValue(0)) : 0;
                        oBookingTouristDTO[i].BookingCode         = dr.ItemArray.GetValue(1) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(1)) : "";
                        oBookingTouristDTO[i].TouristNo           = dr.ItemArray.GetValue(2) != DBNull.Value ? Convert.ToInt32(dr.ItemArray.GetValue(2)) : 0;
                        oBookingTouristDTO[i].FirstName           = dr.ItemArray.GetValue(3) != DBNull.Value ? DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(3))) : "";
                        oBookingTouristDTO[i].MiddleName          = dr.ItemArray.GetValue(4) != DBNull.Value ? DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(4))) : "";
                        oBookingTouristDTO[i].LastName            = dr.ItemArray.GetValue(5) != DBNull.Value ? DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(5))) : "";
                        oBookingTouristDTO[i].Gender              = dr.ItemArray.GetValue(6) != DBNull.Value ? Convert.ToChar(dr.ItemArray.GetValue(6)) : '\0';
                        oBookingTouristDTO[i].NationalityId       = dr.ItemArray.GetValue(7) != DBNull.Value ? Convert.ToInt32(dr.ItemArray.GetValue(7)) : 0;
                        oBookingTouristDTO[i].PassportNo          = dr.ItemArray.GetValue(8) != DBNull.Value ? DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(8))) : "";
                        oBookingTouristDTO[i].DateOfBirth         = dr.ItemArray.GetValue(9) != DBNull.Value ? Convert.ToDateTime(dr.ItemArray.GetValue(9).ToString()) : DateTime.MinValue;
                        oBookingTouristDTO[i].PlaceofBirth        = dr.ItemArray.GetValue(10) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(10)) : "";
                        oBookingTouristDTO[i].PassportIssueDate   = dr.ItemArray.GetValue(11) != DBNull.Value ? Convert.ToDateTime(dr.ItemArray.GetValue(11).ToString()) : DateTime.MinValue;
                        oBookingTouristDTO[i].PassportExpiryDate  = dr.ItemArray.GetValue(12) != DBNull.Value ? Convert.ToDateTime(dr.ItemArray.GetValue(12).ToString()) : DateTime.MinValue;
                        oBookingTouristDTO[i].VisaNo              = dr.ItemArray.GetValue(13) != DBNull.Value ? DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(13))) : "";
                        oBookingTouristDTO[i].VisaExpiryDate      = dr.ItemArray.GetValue(14) != DBNull.Value ? Convert.ToDateTime(dr.ItemArray.GetValue(14).ToString()) : DateTime.MinValue;
                        oBookingTouristDTO[i].IndiaEntryDate      = dr.ItemArray.GetValue(15) != DBNull.Value ? Convert.ToDateTime(dr.ItemArray.GetValue(15).ToString()) : DateTime.MinValue;
                        oBookingTouristDTO[i].ProposedStayInIndia = dr.ItemArray.GetValue(16) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(16)) : "";
                        oBookingTouristDTO[i].ArrivalDateTime     = dr.ItemArray.GetValue(17) != DBNull.Value ? Convert.ToDateTime(dr.ItemArray.GetValue(17)) : DateTime.MinValue;
                        //oBookingTouristDTO[i].ArrivedFrom = dr.ItemArray.GetValue(18) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(18)):"";
                        //oBookingTouristDTO[i].VehicleNo = dr.ItemArray.GetValue(19) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(19)):"";
                        //oBookingTouristDTO[i].TransportCompany = dr.ItemArray.GetValue(20) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(20)):"";
                        //oBookingTouristDTO[i].TransportMode = dr.ItemArray.GetValue(21) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(21)):"";
                        oBookingTouristDTO[i].RoomDetails = dr.ItemArray.GetValue(22) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(22)) : "";
                        //oBookingTouristDTO[i].NextDestination = dr.ItemArray.GetValue(23) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(23)):"";
                        oBookingTouristDTO[i].departuredate           = dr.ItemArray.GetValue(24) != DBNull.Value ? Convert.ToDateTime(dr.ItemArray.GetValue(24)):DateTime.MinValue;
                        oBookingTouristDTO[i].EmployedinIndia         = dr.ItemArray.GetValue(25) != DBNull.Value ? Convert.ToBoolean(dr.ItemArray.GetValue(25)) : false;
                        oBookingTouristDTO[i].VisitPurpose            = dr.ItemArray.GetValue(26) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(26)) : "";
                        oBookingTouristDTO[i].PermanentAddressInIndia = dr.ItemArray.GetValue(27) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(27)) : "";
                        //oBookingTouristDTO[i].MealPlan = dr.ItemArray.GetValue(28) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(28)):"";
                        oBookingTouristDTO[i].Allergies       = dr.ItemArray.GetValue(29) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(29)) : "";
                        oBookingTouristDTO[i].MealPreferences = dr.ItemArray.GetValue(30) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(30)) : "";
                        oBookingTouristDTO[i].SpecialMessage  = dr.ItemArray.GetValue(31) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(31)) : "";
                        //oBookingTouristDTO[i].VehicleName = dr.ItemArray.GetValue(32) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(32)) : "";
                        //oBookingTouristDTO[i].DriverName = dr.ItemArray.GetValue(33) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(33)) : "";
                        //oBookingTouristDTO[i].DriverPhoneNo = dr.ItemArray.GetValue(34) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(34)) : "";
                        //oBookingTouristDTO[i].TransportPhoneNo = dr.ItemArray.GetValue(35) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(35)) : "";
                        oBookingTouristDTO[i].Suffix             = dr.ItemArray.GetValue(36) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(36)) : "";
                        oBookingTouristDTO[i].Nationality        = GetNationalityName(oBookingTouristDTO[i].NationalityId);
                        oBookingTouristDTO[i].CFormNo            = dr.ItemArray.GetValue(37) != DBNull.Value ? Convert.ToInt32(dr.ItemArray.GetValue(37)) : 0;
                        oBookingTouristDTO[i].EmailId            = dr.ItemArray.GetValue(38) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(38)) : "";
                        oBookingTouristDTO[i].arrivalvehiaclno   = dr.ItemArray.GetValue(40) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(40)) : "";
                        oBookingTouristDTO[i].departurevehicalno = dr.ItemArray.GetValue(41) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(41)) : "";
                        oBookingTouristDTO[i].departureairport   = dr.ItemArray.GetValue(42) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(42)) : "";
                        oBookingTouristDTO[i].arrivalairport     = dr.ItemArray.GetValue(43) != DBNull.Value ? Convert.ToString(dr.ItemArray.GetValue(43)) : "";
                    }
                    #endregion AssigningValues
                }
            }
            return(oBookingTouristDTO);
        }
    protected void btnSmbt_Click(object sender, EventArgs e)
    {
        if (Session["UserCode"] != null)
        {
            //  pnlLogin.Visible = true;
            try
            {
                customerLogin.Visible = false;
                if (Session["AgentMailId"] != null && Session["Password"] != null)
                {
                    blagentpayment._Action   = "MailValidate";
                    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;
                        pnlBookButton.Visible  = true;

                        if (oncredit)
                        {
                            panelwithoutCreditAgent.Visible = false;
                            btnPayProceed.Text = "Book";
                        }
                        else
                        {
                            panelwithoutCreditAgent.Visible = true;
                            btnPayProceed.Text = "Proceed For Payment";
                        }
                    }
                    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
            {
                blcus.Email    = Session["CustomerMailId"].ToString();;
                blcus.Password = Session["CustPassword"].ToString();
                blcus.action   = "LoginCust";

                DataTable dtCustomer = dlcus.checkDuplicateemail(blcus);
                if (dtCustomer != null)
                {
                    Session["CustMailId"] = Session["CustomerMailId"].ToString();

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


                    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"]     = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["CustId"].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;
                }
                Bookingdt = SessionServices.RetrieveSession <DataTable>("Bookingdt");
                // preparetables(Bookingdt);
            }
            catch
            {
            }
        }
        else
        {
            pnlLogin.Visible      = false;
            customerLogin.Visible = true;
        }

        //Bookingdt = Session["Bookingdt"] as DataTable;
        //preparetables(Bookingdt);
    }
    protected void btnPayProceed_Click(object sender, EventArgs e)
    {
        try
        {
            Session["Hotel"] = 1;
            if (btnPayProceed.Text == "Proceed For Payment")
            {
                if (Session["UserCode"] != null)
                {
                    //[email protected] [1:48:55 PM] Augurs  Technologies Pvt. Ltd.: 12345

                    DataTable dtrpax = SessionServices.RetrieveSession <DataTable>("Bookingdt");

                    string BookRef = txtBookRef.Text + "X" + Convert.ToDouble(dtrpax.Compute("SUM(Pax)", string.Empty)).ToString();

                    Session.Add("BookingRef", BookRef);
                    Session["Paid"]          = Convert.ToDouble(txtPaidAmt.Text.Trim() == "" ? "0" : txtPaidAmt.Text.Trim());
                    blagentpayment._Action   = "MailValidate";
                    blagentpayment._EmailId  = Session["AgentMailId"].ToString();
                    blagentpayment._Password = Session["Password"].ToString();
                    DataTable dtAgent = dlagentpayment.BindControls(blagentpayment);
                    if (dtAgent.Rows.Count > 0)
                    {
                        string BookingPayId   = lbPaymentMethod.Text.Trim().Substring(0, 2) + DateTime.Now.ToString("MMddhhmmssfff");
                        string Email          = Session["AgentMailId"].ToString();
                        string PhoneNumber    = hdnfPhoneNumber.Value.Trim().ToString();
                        string FirstName      = DataSecurityManager.Decrypt(dtAgent.Rows[0]["FirstName"].ToString());
                        string LastName       = DataSecurityManager.Decrypt(dtAgent.Rows[0]["LastName"].ToString());
                        string PaidAmt        = hftxtpaidamt.Value.Trim().ToString();
                        string PaymentId      = BookingPayId.ToString();
                        string BillingAddress = lblBillingAddress.Text.Trim().ToString();
                        Session["BookingPayId"] = txtBookRef.Text.Trim();// BookingPayId;

                        Session["Address"] = BillingAddress;
                        Session["InvName"] = FirstName;

                        Session["SubInvName"] = FirstName;
                        //Response.Redirect("PaymentGatewayResponse.aspx?BookingPayId=" + PaymentId + "&EmailId=" + Email.ToString() + "&PhoneNumber=" + PhoneNumber.ToString() + "&FirstName=" + FirstName.ToString() + "&LastName=" + LastName.ToString() + "&PaidAmt=" + PaidAmt.ToString() + "&BillingAddress=" + BillingAddress.ToString());
                        //http://adventureresortscruises.in/Cruise/booking/sendtoairpay.aspx?BookedId=0&PackName=7N8D+Downstream+Cruise&NoOfNights=7&CheckinDate=12%2f4%2f2016&PackId=Pack4
                        Response.Redirect("~/Cruise/booking/sendtoairpay.aspx?BookingPayId=" + PaymentId + "&EmailId=" + Email.ToString() + "&PhoneNumber=" + PhoneNumber.ToString() + "&FirstName=" + FirstName.ToString() + "&LastName=" + LastName.ToString() + "&PaidAmt=" + PaidAmt.ToString() + "&BillingAddress=" + BillingAddress.ToString());
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('not registered!!!')", true);
                    }
                }
                else
                {
                    Session.Add("BookingRef", ViewState["BookRef"].ToString());

                    blcus.Email    = Session["CustomerMailId"].ToString();
                    blcus.Password = Session["CustPassword"].ToString();

                    blcus.action = "LoginCust";
                    DataTable dtCustomer = dlcus.checkDuplicateemail(blcus);
                    Session["Paid"] = Convert.ToDouble(txtPaidAmt.Text.Trim() == "" ? "0" : txtPaidAmt.Text.Trim());
                    if (dtCustomer.Rows.Count > 0)
                    {
                        Random rnd          = new Random();
                        string BookingPayId = rnd.Next(10000, 20000).ToString() + DateTime.Now.ToString("MMddhhmmssfff");
                        Session["BookingPayId"] = BookingPayId;
                        string Email = Session["CustomerMailId"].ToString();

                        string PhoneNumber    = hdnfPhoneNumber.Value.Trim().ToString();
                        string FirstName      = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString());
                        string LastName       = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString());
                        string PaidAmt        = hftxtpaidamt.Value.Trim().ToString();
                        string PaymentId      = BookingPayId.ToString();
                        string BillingAddress = lblBillingAddress.Text.Trim().ToString();
                        Session["Address"]    = BillingAddress;
                        Session["InvName"]    = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Title"].ToString()) + " " + LastName;
                        Session["SubInvName"] = LastName + ", " + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Title"].ToString()) + " " + FirstName;

                        Response.Redirect("~/Cruise/booking/sendtoairpay.aspx?BookingPayId=" + PaymentId + "&EmailId=" + Email.ToString() + "&PhoneNumber=" + PhoneNumber.ToString() + "&FirstName=" + FirstName.ToString() + "&LastName=" + LastName.ToString() + "&PaidAmt=" + PaidAmt.ToString() + "&BillingAddress=" + BillingAddress.ToString());

                        //http://localhost:1897/ResortManager/Cruise/booking/SummerisedDetails.aspx?BookedId=0&PackName=Ganges+Exclusive&NoOfNights=5&CheckinDate=5%2f1%2f2016

                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('not registered!!!')", true);
                    }
                }
            }
            else
            {
                if (Convert.ToDecimal(txtPaidAmt.Text) <= Convert.ToDecimal(hdnfCreditLimit.Value))
                {
                    string BookingPayId = lbPaymentMethod.Text.Trim().Substring(0, 2) + DateTime.Now.ToString("MMddhhmmssfff");
                    Session["BookingPayId"] = BookingPayId;
                    Session.Add("BookingRef", txtBookRef.Text.Trim().ToString());
                    Session["Paid"] = Convert.ToDouble(hftxtpaidamt.Value.Trim() == "" ? "0" : hftxtpaidamt.Value.Trim().ToString());

                    Session["InvName"] = Session["UserName"].ToString();
                    Session["Address"] = null;
                    Response.Redirect("PaymentGatewayResponse.aspx");
                }
                else
                {
                    lblPaymentErr.Text = "Payment Amount Exceeding Credit Limit";
                }
            }
        }
        catch
        {
        }
    }
    private void BindAgents()
    {
        try
        {
            blAr._Action      = "GetAllAgents";
            dtGetReturnedData = dlAr.BindControls(blAr);

            List <BALAgent> agents = new List <BALAgent>();

            if (dtGetReturnedData != null && dtGetReturnedData.Rows.Count > 0)
            {
                foreach (DataRow row in dtGetReturnedData.Rows)
                {
                    BALAgent agent = new BALAgent {
                        AgentId = Convert.ToInt32(row["AgentId"].ToString()), AgentName = DataSecurityManager.Decrypt(row["AgentName"].ToString())
                    };
                    agents.Add(agent);
                }

                List <BALAgent> sortedAgents = agents.OrderBy(a => a.AgentName).ToList();

                ddlAgents.DataSource     = sortedAgents;
                ddlAgents.DataTextField  = "AgentName";
                ddlAgents.DataValueField = "AgentId";
                ddlAgents.DataBind();
                ddlAgents.Items.Insert(0, "-Select-");
            }
            else
            {
                GridAccomodations.DataSource = null;
                GridAccomodations.DataBind();
            }
        }
        catch (Exception sqe)
        {
            GridAccomodations.DataSource = null;
            GridAccomodations.DataBind();
        }
    }
예제 #26
0
    protected void btnCustLogin_Click(object sender, EventArgs e)

    {
        if (rdbAgent.Checked == true || rdbCustomer.Checked == true)
        {
        }
        if (rdbAgent.Checked == true && rdbCustomer.Checked == true)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Please select only one type')", true);

            return;
        }
        if (rdbCustomer.Checked == true)
        {
            if (IsEmailValid(txtCustMailId.Value) == true)
            {
                if (Session["CustomerMailId"] == null)
                {
                    try
                    {
                        // blcus.Email = txtCustMailId.Value
                        blcus.Email = DataSecurityManager.Encrypt(txtCustMailId.Value.Trim());

                        blcus.action = "checkemail";
                        DataTable dtCustomer = dlcus.checkmail(blcus);
                        if (dtCustomer != null && dtCustomer.Rows.Count > 0)
                        {
                            string password = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Password"].ToString());
                            sendMail(txtCustMailId.Value, password);
                            txtCustMailId.Value = "";
                            rdbAgent.Checked    = false;
                            rdbCustomer.Checked = false;
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('We have send an email with your password,Please check your email')", true);

                            //lblMsg.Text = "We have send an email with your password,Please check your email id";
                            //lblMsg.ForeColor = System.Drawing.Color.Green;
                            //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;
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('This is not registered email')", true);
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('You are already log in')", true);
                    return;
                    //lblMsg.Text = "You are already log in";
                    //lblMsg.ForeColor = System.Drawing.Color.Red;
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Please enter valid email ')", true);
                return;
                //lblMsg.Text = "Please enter valid email id";
                //lblMsg.ForeColor = System.Drawing.Color.Red;
            }
        }
        if (rdbAgent.Checked == true)
        {
            if (IsEmailValid(txtCustMailId.Value) == true)
            {
                if (Session["AgentMailId"] == null)
                {
                    try
                    {
                        // bagnt._EmailId = txtCustMailId.Value;
                        bagnt._EmailId = DataSecurityManager.Encrypt(txtCustMailId.Value.Trim());

                        bagnt._Action = "checkagentemail";
                        DataTable dtagent = dagnt.checkagentemail(bagnt);
                        if (dtagent != null && dtagent.Rows.Count > 0)
                        {
                            // string password = dtagent.Rows[0]["Password"].ToString();
                            string password = DataSecurityManager.Decrypt(dtagent.Rows[0]["Password"].ToString());
                            sendMail(txtCustMailId.Value, password);
                            txtCustMailId.Value = "";
                            rdbAgent.Checked    = false;
                            rdbCustomer.Checked = false;
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('We have send an email with your password,Please check your email ')", true);
                            //lblMsg.Text = "We have send an email with your password,Please check your email id";
                            //lblMsg.ForeColor = System.Drawing.Color.Green;
                            //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;
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('This is not registered email')", true);
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('You are already log in ')", true);
                    return;
                    //lblMsg.Text = "You are already log in";
                    //lblMsg.ForeColor = System.Drawing.Color.Red;
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Please enter valid email id')", true);
                return;
                //lblMsg.Text = "Please enter valid email id";
                //lblMsg.ForeColor = System.Drawing.Color.Red;
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Please select type')", true);
            return;
            //lblMsg.Text = "Please select type";
            //lblMsg.ForeColor = System.Drawing.Color.Red;
        }
    }
예제 #27
0
        public BookingTouristDTO[] GetTourists(int BookingId)
        {
            DataSet ds;
            DataRow dr;

            BookingTouristDTO[] oBookingTouristDTO;

            string sProcName;

            oBookingTouristDTO = null;
            try
            {
                oDB       = new DatabaseManager();
                sProcName = "up_Get_Tourists";
                oDB.DbCmd = oDB.GetStoredProcCommand(sProcName);

                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@BookingId", DbType.Int32, BookingId);
                ds  = oDB.ExecuteDataSet(oDB.DbCmd);
                oDB = null;
            }
            catch (Exception exp)
            {
                oDB = null;
                ds  = null;
                GF.LogError("clsBookingTouristHandler.GetTourist", exp.Message);
            }

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    oBookingTouristDTO = new BookingTouristDTO[ds.Tables[0].Rows.Count];
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)

                    {
                        dr = ds.Tables[0].Rows[i];
                        oBookingTouristDTO[i] = new BookingTouristDTO();
                        if (dr.ItemArray.GetValue(0) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].BookingId = Convert.ToInt32(dr.ItemArray.GetValue(0));
                        }
                        if (dr.ItemArray.GetValue(1) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].BookingCode = Convert.ToString(dr.ItemArray.GetValue(1));
                        }
                        if (dr.ItemArray.GetValue(2) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].TouristNo = Convert.ToInt32(dr.ItemArray.GetValue(2));
                        }
                        if (dr.ItemArray.GetValue(3) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].FirstName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(3)));
                        }
                        if (dr.ItemArray.GetValue(4) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].MiddleName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(4)));
                        }
                        if (dr.ItemArray.GetValue(5) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].LastName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(5)));
                        }
                        if (dr.ItemArray.GetValue(6) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].RoomDetails = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(6)));
                        }
                        if (dr.ItemArray.GetValue(7) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].Gender = (Convert.ToChar(dr.ItemArray.GetValue(7)));
                        }
                        if (dr.ItemArray.GetValue(8) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].DateOfBirth = Convert.ToDateTime(Convert.ToDateTime(dr.ItemArray.GetValue(8)).ToString());
                        }
                        if (dr.ItemArray.GetValue(9) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].Nationality = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(9)));
                        }
                        if (dr.ItemArray.GetValue(10) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].PassportNo = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(10)));
                        }
                        if (dr.ItemArray.GetValue(11) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].VisaExpiryDate = Convert.ToDateTime(dr.ItemArray.GetValue(11));
                        }
                        if (dr.ItemArray.GetValue(12) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].ArrivalDateTime = Convert.ToDateTime(dr.ItemArray.GetValue(12));
                        }
                        if (dr.ItemArray.GetValue(13) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].vehicalno = Convert.ToString(dr.ItemArray.GetValue(13));
                        }
                        if (dr.ItemArray.GetValue(14) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].departuredate = Convert.ToDateTime(dr.ItemArray.GetValue(14));
                        }
                        if (dr.ItemArray.GetValue(15) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].departureairport = Convert.ToString(dr.ItemArray.GetValue(15));
                        }
                        if (dr.ItemArray.GetValue(16) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].guestname = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(16))) + ". " + DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(3))) + " " + DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(5)));
                        }
                        if (dr.ItemArray.GetValue(17) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].arrivalvehiaclno = Convert.ToString(dr.ItemArray.GetValue(17));
                        }
                        if (dr.ItemArray.GetValue(18) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].departurevehicalno = Convert.ToString(dr.ItemArray.GetValue(18));
                        }
                        if (dr.ItemArray.GetValue(20) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].arrivalairport = Convert.ToString(dr.ItemArray.GetValue(20));
                        }
                    }
                }
            }
            return(oBookingTouristDTO);
        }
예제 #28
0
    protected override void OnLoad(EventArgs e)
    {
        // ... add custom logic here ...

        // Be sure to call the base class's OnLoad method!



        //Session["CssPath"] = "";

        if (Convert.ToString(Request.QueryString["agentid"]) != null)
        {
            // string agentid = Request.QueryString["agentid"];
            int agentid = 0;
            agentid = Convert.ToInt32(Request.QueryString["agentid"]);
            SqlDataAdapter adp = new SqlDataAdapter("select CssPath,AgentEmailId,IsPaymentByPass from tblagentmaster where agentid=" + agentid + "", strCon);
            DataTable      dt  = new DataTable();
            adp.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                string path = dt.Rows[0][0].ToString();
                Session["CssPath"] = path;
                Session["AgentId"] = agentid;

                string email = DataSecurityManager.Decrypt(dt.Rows[0][1].ToString());
                Session["AgentEmailId"] = email;
                string ss = dt.Rows[0][2].ToString();
                if (ss != "")
                {
                    Session["IsPaymentByPass"] = Convert.ToBoolean(dt.Rows[0][2]);
                }
                else
                {
                    Session["IsPaymentByPass"] = false;
                }
                AddCss(path);


                try
                {
                    if (Session["SetCurrency"].ToString() == "")
                    {
                        Session["SetCurrency"] = "INR";
                    }
                }catch { Session["SetCurrency"] = "INR"; }
                //Response.Cookies["agentInfo"]["CssPath"] = path;
                //Response.Cookies["agentInfo"]["AgentId"] = Convert.ToInt32(agentid).ToString();
                //Response.Cookies["agentInfo"]["AgentEmailId"] = email;
                //Response.Cookies["agentInfo"]["IsPaymentByPass"] = Convert.ToBoolean(dt.Rows[0][2]).ToString();
                //Response.Cookies["agentInfo"].Expires = DateTime.Now.AddDays(1);

                HttpCookie aCookie = new HttpCookie("agentInfo");
                aCookie.Values["CssPath"]      = path;
                aCookie.Values["AgentId"]      = Convert.ToInt32(agentid).ToString();
                aCookie.Values["AgentEmailId"] = email;
                if (ss != "")
                {
                    aCookie.Values["IsPaymentByPass"] = Convert.ToBoolean(dt.Rows[0][2]).ToString();
                }
                else
                {
                    aCookie.Values["IsPaymentByPass"] = false.ToString();
                }
                aCookie.Expires = DateTime.Now.AddDays(1);
                Response.Cookies.Add(aCookie);



                //  changeCss.Href = "~/Cruise/Booking/css/agent_css/green.css";
            }
        }

        //else if (Session["AgentId"]!=null)
        else if (Request.Cookies["agentInfo"] != null)
        {
            if (Convert.ToString(Request.QueryString["agentid"]) == null)
            {
                Session["CssPath"]         = null;
                Session["AgentId"]         = null;
                Session["AgentEmailId"]    = null;
                Session["IsPaymentByPass"] = null;
                //Session["SetCurrency"] = "";
            }
            else
            {
                HttpCookie reqCookies = Request.Cookies["agentInfo"];
                if (reqCookies != null)
                {
                    string csspath = reqCookies["CssPath"].ToString();
                    int    agentid = Convert.ToInt32(reqCookies["AgentId"]);
                    string email   = reqCookies["AgentEmailId"].ToString();
                    bool   ss      = Convert.ToBoolean(reqCookies["IsPaymentByPass"]);
                    Session["CssPath"] = csspath;
                    Session["AgentId"] = agentid; Session["AgentEmailId"] = email; Session["IsPaymentByPass"] = ss;

                    AddCss(csspath);
                }
            }
            // AddCss(Convert.ToString( Session["CssPath"]));
        }
        else
        {
            //Session["SetCurrency"] = "";
        }
        //else
        //{
        //    Session["CssPath"] = "/Cruise/Booking/css/Newcss/style.css";

        //}



        base.OnLoad(e);
    }
예제 #29
0
        public BookingTouristDTO[] GetTouristsftr(string bcode, string email, string ppno, string firstName, DateTime chkin, DateTime chkout, int accomid)
        {
            DataSet ds;
            DataRow dr;

            BookingTouristDTO[] oBookingTouristDTO;

            string sProcName;

            oBookingTouristDTO = null;
            try
            {
                oDB       = new DatabaseManager();
                sProcName = "up_Get_Touristsftr";
                oDB.DbCmd = oDB.GetStoredProcCommand(sProcName);

                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@BookingCode", DbType.String, bcode);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@name", DbType.String, DataSecurityManager.Encrypt(firstName));
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@EmailId", DbType.String, email);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@passportNo", DbType.String, DataSecurityManager.Encrypt(ppno));

                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@chkindate", DbType.Date, chkin);

                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@chkoutdate", DbType.Date, chkout);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@accomid", DbType.Int32, accomid);
                ds  = oDB.ExecuteDataSet(oDB.DbCmd);
                oDB = null;
            }
            catch (Exception exp)
            {
                oDB = null;
                ds  = null;
                //    GF.LogError("clsBookingTouristHandler.GetTourist", exp.Message);
            }

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    oBookingTouristDTO = new BookingTouristDTO[ds.Tables[0].Rows.Count];
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        dr = ds.Tables[0].Rows[i];
                        oBookingTouristDTO[i] = new BookingTouristDTO();
                        if (dr.ItemArray.GetValue(0) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].BookingCode = Convert.ToString(dr.ItemArray.GetValue(0));
                        }
                        if (dr.ItemArray.GetValue(1) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].BookingRef = Convert.ToString(dr.ItemArray.GetValue(1));
                        }
                        if (dr.ItemArray.GetValue(2) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].AgentName = dr.ItemArray.GetValue(2) != DBNull.Value ? DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(2))) : string.Empty;
                        }
                        //if (dr.ItemArray.GetValue(3) != DBNull.Value)
                        //    oBookingTouristDTO[i].ClientName = Convert.ToString(dr.ItemArray.GetValue(3));
                        if (dr.ItemArray.GetValue(4) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].Gender = Convert.ToChar(dr.ItemArray.GetValue(4));
                        }
                        if (dr.ItemArray.GetValue(5) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].DateOfBirth = Convert.ToDateTime(dr.ItemArray.GetValue(5));
                        }
                        if (dr.ItemArray.GetValue(6) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].Nationality = Convert.ToString(dr.ItemArray.GetValue(6));
                        }
                        if (dr.ItemArray.GetValue(7) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].PassportNo = dr.ItemArray.GetValue(7) != DBNull.Value ? DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(7))) : string.Empty;
                        }
                        if (dr.ItemArray.GetValue(8) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].AccomName = Convert.ToString(dr.ItemArray.GetValue(8));
                        }
                        if (dr.ItemArray.GetValue(9) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].CheckinDate = Convert.ToDateTime(dr.ItemArray.GetValue(9));
                        }
                        if (dr.ItemArray.GetValue(10) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].CheckoutDate = Convert.ToDateTime(dr.ItemArray.GetValue(10));
                        }
                        if (dr.ItemArray.GetValue(11) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].EmailId = Convert.ToString(dr.ItemArray.GetValue(11));
                        }

                        if (dr.ItemArray.GetValue(12) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].BookingId = Convert.ToInt32(dr.ItemArray.GetValue(12));
                        }
                        if (dr.ItemArray.GetValue(13) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].TouristNo = Convert.ToInt32(dr.ItemArray.GetValue(13));
                        }

                        if (dr.ItemArray.GetValue(14) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].FirstName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(14)));
                        }
                        if (dr.ItemArray.GetValue(15) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].MiddleName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(15)));
                        }
                        if (dr.ItemArray.GetValue(16) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].LastName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(16)));
                        }
                    }
                }
            }
            return(oBookingTouristDTO);
        }
예제 #30
0
    protected void dgBookings_ItemCommand(object source, DataGridCommandEventArgs e)
    {
        string cFormUrl = string.Empty;

        try
        {
            if (e.Item.ItemIndex >= 0)
            {
                int iBookingID = Convert.ToInt32(dgBookings.DataKeys[e.Item.ItemIndex].ToString());
                switch (e.CommandName.ToString().ToUpper())
                {
                case "EDIT":
                    Response.Redirect("Booking.aspx?bid=" + iBookingID);
                    break;

                case "VIEW":
                    if (string.Compare(e.Item.Cells[5].Text, "CONFIRMED", true) == 0)
                    {
                        Response.Redirect("Bookingconfirmation.aspx?bid=" + iBookingID.ToString());
                    }
                    else
                    {
                        Response.Redirect("Booking.aspx?bid=" + iBookingID.ToString() + "&mode=view");
                    }
                    break;

                case "CONFIRMATION":
                    Response.Redirect("Bookingconfirmation.aspx?bid=" + iBookingID.ToString());
                    break;

                case "VIEWTOURIST":
                    Response.Redirect("ViewTourists.aspx?bid=" + iBookingID.ToString());
                    break;

                case "ADDTOURIST":
                    Response.Redirect("touristdetails.aspx?bid=" + iBookingID.ToString());
                    break;

                case "CFORMFOREIGNNATIONAL":
                    Response.Redirect("CFormReport.aspx?bid=" + iBookingID.ToString() + "&cftype=fn");
                    break;

                case "CFORMINDIANNATIONAL":
                    Response.Redirect("CFormReport.aspx?bid=" + iBookingID.ToString() + "&cftype=in");
                    break;

                case "UPLOADTOURIST":
                    Response.Redirect("~\\uploader.aspx?bid=" + iBookingID.ToString() + "&upload=" + ENums.UploadXMLType.Tourist.ToString());
                    break;

                case "REMINDER":
                    //Reminder Email
                    //DialogResult result = MessageBox.Show("Are you sure you want to send reminder to the guest for the payment at" + DataSecurityManager.Decrypt(Session["Email"].ToString())+ "", "Yes or No", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

                    //if (result == DialogResult.Yes)
                    //{

                    blbooking._iBookingId = iBookingID;
                    DataTable dt = dlbooking.paymentreminder(blbooking);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        Session["Email"]     = dt.Rows[0]["Email"].ToString();
                        Session["AccomName"] = dt.Rows[0]["AccomName"].ToString();
                        double amt = 0;
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            amt = amt + Convert.ToDouble(dt.Rows[i]["Amount"].ToString());
                        }
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:if(confirm('Are you sure you want to send reminder to the guest for the payment at " + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "?');", true);
                        // ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:if(confirm('Are you sure you want to send reminder to the guest for the payment at " + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "?')==false)return false;", true);

                        //RegisterClientScriptBlock
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:confirm('Are you sure you want to send reminder to the guest for the payment at" + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "?')", true);

                        ScriptManager.RegisterStartupScript(this, GetType(), "Sc", "confirmation('" + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "');", true);
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:confirmation('" + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "')", true);

                        //DialogResult result = MessageBox.Show("Are you sure you want to send reminder to the guest for the payment at  " + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "", "Yes or No", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

                        //if (result == DialogResult.Yes)
                        //{
                        string L = dt.Rows[0]["LastName"].ToString();
                        if (L == " ")
                        {
                            dt.Rows[0]["LastName"] = "XYZ";
                        }

                        sendMail(DataSecurityManager.Decrypt(dt.Rows[0]["Email"].ToString()), DataSecurityManager.Decrypt(dt.Rows[0]["Name"].ToString()), DataSecurityManager.Decrypt(dt.Rows[0]["LastName"].ToString()), iBookingID, amt, Convert.ToDouble(dt.Rows[0]["PaidAmt"].ToString()), dt.Rows[0]["StartDate"].ToString(), dt.Rows[0]["enddate"].ToString(), dt.Rows[0]["BookingCode"].ToString(), Convert.ToDateTime(dt.Rows[0]["BookingDate"].ToString()), dt.Rows[0]["Packagename"].ToString(), dt.Rows[0]["AccomName"].ToString(), dt.Rows[0]["RegionName"].ToString(), DataSecurityManager.Decrypt(dt.Rows[0]["Title"].ToString()), DataSecurityManager.Decrypt(dt.Rows[0]["Password"].ToString()));

                        // }

                        RefreshGrid();
                    }
                    else
                    {
                        RefreshGrid();
                    }
                    //}
                    //else if (result == DialogResult.No)
                    //{
                    //    RefreshGrid();
                    //}


                    break;

                default:
                    break;
                }
            }
        }
        catch (Exception exp)
        {
            GF.LogError("ViewBookings.dgBookings_ItemCommand", exp.Message);
            return;
        }
    }