Esempio n. 1
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        Hashtable h1 = new Hashtable();

        h1.Add("id", lblMainId.Text);
        Response.Redirect("~/Admin/AddEditNews.aspx?data=" + CommonShared.EncryptQueryString(h1));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        CompareValidator1.ValueToCompare = DateTime.Today.ToString("MM/dd/yyyy");
        //txtDesc.BasePath = ConfigurationManager.AppSettings["FCKBasePath"].ToString();
        txtDesc.BasePath = AppConfig.FCKBasePath;
        if (!IsPostBack)
        {
            if (Session["AccountDetail"] != null)
            {
                SetDeafultPageSize();
                //gvCategory.VirtualItemCount = Convert.ToInt32(BAL_News.GetTotalNewsCount());

                //set the gridview initial pageindex into viewstate
                gvIndex = gvCategory.PageIndex;
                FillGrid();
                string str = Convert.ToString(CommonShared.DecryptQueryString("id", Request.QueryString["data"]));
                if (!string.IsNullOrEmpty(str))
                {
                    lblMode.Text = str;
                    Label4.Text  = "Edit News/Events";
                    GetRecords();
                }
                else
                {
                    Label4.Text  = "Add News/Events";
                    lblMode.Text = "0";
                }
            }
            else
            {
                Response.Redirect("~/AdminLogin.aspx");
            }
        }
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ChekcNamefirst.ValidationExpression      = AppConfig.CheckNameRegEx;
        checklastnameforreg.ValidationExpression = AppConfig.CheckNameRegEx;

        if (!IsPostBack)
        {
            if (Session["AccountDetail"] != null)
            {
                SetDeafultPageSize();
                //gvAdminList.VirtualItemCount = Convert.ToInt32(BAL_AdminList.GetTotalAdminCount());

                // set the gridview initial pageindex into viewstate
                gvIndex = gvAdminList.PageIndex;
                FillGrid(string.Empty, string.Empty);
                string str = Convert.ToString(CommonShared.DecryptQueryString("id", Request.QueryString["data"]));
                if (!string.IsNullOrEmpty(str))
                {
                    lblMode.Text = str;
                    Label4.Text  = "Edit Admin";
                    GetRecords();
                }
                else
                {
                    Label4.Text  = "Add Admin";
                    lblMode.Text = "0";
                }
            }
            else
            {
                Response.Redirect("~/AdminLogin.aspx");
            }
        }
    }
Esempio n. 4
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        //change the user password if password match
        if (lblPassword.Text == CommonShared.EnryptString(txtOldPassword.Text.Trim()))
        {
            if (BAL_Registration.ChangeCustomerPassword(CommonShared.EnryptString(txtOldPassword.Text.Trim()), CommonShared.EnryptString(txtNewPassword.Text.Trim()), Convert.ToInt32(lblCustomerId.Text)) == true)
            {
                DataTable table = BAL_Registration.GetRecordsForUser(Convert.ToInt32(lblCustomerId.Text));
                if (table != null)
                {
                    if (table.Rows.Count > 0)
                    {
                        CustomerSessions cs = new CustomerSessions();

                        cs.CustomerId     = Convert.ToInt32(table.Rows[0]["CustomerId"]);
                        cs.FirstName      = Convert.ToString(table.Rows[0]["FirstName"]);
                        cs.LastName       = Convert.ToString(table.Rows[0]["LastName"]);
                        cs.Sex            = char.Parse(Convert.ToString(table.Rows[0]["Sex"]));
                        cs.Email          = Convert.ToString(table.Rows[0]["EmailId"]);
                        cs.Password       = Convert.ToString(table.Rows[0]["Password"]);
                        cs.Address1       = Convert.ToString(table.Rows[0]["BAddress1"]);
                        cs.Address2       = Convert.ToString(table.Rows[0]["BAddress2"]);
                        cs.City           = Convert.ToString(table.Rows[0]["BCityName"]);
                        cs.State          = Convert.ToString(table.Rows[0]["BStateName"]);
                        cs.Country        = Convert.ToString(table.Rows[0]["BCountryName"]);
                        cs.ZipCode        = Convert.ToString(table.Rows[0]["BZip"]);
                        cs.PhoneNo        = Convert.ToString(table.Rows[0]["BPhone"]);
                        cs.BusinessName   = Convert.ToString(table.Rows[0]["BusinessName"]);
                        cs.ZipCode        = Convert.ToString(table.Rows[0]["BZip"]);
                        cs.BFax           = Convert.ToString(table.Rows[0]["BFax"]);
                        cs.BContactPerson = Convert.ToString(table.Rows[0]["BContactPerson"]);
                        //store object into session
                        Session["CustomerSessions"] = cs;

                        //store object into session
                        Session["CustomerSessions"] = cs;
                        Response.Redirect("~/User/Members.aspx");
                    }
                }
            }
            else
            {
                Label5.Visible = true;
                Label5.Text    = "Error in password changed.Please try again";
            }
        }
        else
        {
            Label5.Visible = true;
        }
    }
Esempio n. 5
0
 private bool CheckDeskRights(DeskRightPositions rightPosition)
 {
     return(CurrentDeskFacade.CheckRight(CurrentDesk, CommonShared.GetArrayUserFromString(), rightPosition));
 }
Esempio n. 6
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(txtUsername.Text) && !string.IsNullOrEmpty(txtPassword.Text))
        {
            DataTable table = BAL_UserLogin.Login_Verify(Convert.ToString(txtUsername.Text), CommonShared.EnryptString(Convert.ToString(txtPassword.Text)));
            if (table != null)
            {
                if (table.Rows.Count > 0)
                {
                    CustomerSessions cs = new CustomerSessions();

                    cs.CustomerId = Convert.ToInt32(table.Rows[0]["CustomerId"]);
                    cs.FirstName  = Convert.ToString(table.Rows[0]["FirstName"]);
                    cs.LastName   = Convert.ToString(table.Rows[0]["LastName"]);
                    cs.Sex        = char.Parse(Convert.ToString(table.Rows[0]["Sex"]));
                    cs.Email      = Convert.ToString(table.Rows[0]["EmailId"]);
                    cs.Password   = Convert.ToString(table.Rows[0]["Password"]);
                    cs.Address1   = Convert.ToString(table.Rows[0]["Address1"]);
                    cs.Address2   = Convert.ToString(table.Rows[0]["Address2"]);
                    cs.CityId     = Convert.ToInt32(table.Rows[0]["CityId"]);
                    cs.City       = Convert.ToString(table.Rows[0]["City"]);
                    cs.StateId    = Convert.ToInt32(table.Rows[0]["StateId"]);
                    cs.State      = Convert.ToString(table.Rows[0]["State"]);
                    cs.CountryId  = Convert.ToInt32(table.Rows[0]["CountryId"]);
                    cs.Country    = Convert.ToString(table.Rows[0]["Country"]);
                    cs.ZipCode    = Convert.ToString(table.Rows[0]["ZipCode"]);
                    cs.PhoneNo    = Convert.ToString(table.Rows[0]["PhoneNo"]);


                    //store object into session
                    Session["CustomerSessions"] = cs;

                    if (string.IsNullOrEmpty(ProductDetails))
                    {
                        if (string.IsNullOrEmpty(lblCheckOut.Text))
                        {
                            Response.Redirect("~/User/Members.aspx");
                        }
                        else
                        {
                            Response.Redirect("~/User/Checkout.aspx");
                        }
                    }
                    else
                    {
                        if (btnHandler != null)
                        {
                            btnHandler("ProductDetails");
                        }
                    }
                }
                else
                {
                    lblLoginError.Text = "Invalid UserName or Password";
                    txtPassword.Text   = "";
                    txtUsername.Text   = "";
                }
            }
        }
    }
Esempio n. 7
0
    public void Rewrite_BeginRequest(object sender, System.EventArgs args)
    {
        string strURI  = HttpContext.Current.Request.Url.ToString();
        string strPath = HttpContext.Current.Request.Url.AbsolutePath;

        #region URL Rewriting For Large Images
        if (strPath.Contains("/LargeImage.aspx"))
        {
            string _QueryString = CommonShared.DecryptQueryString("id", HttpContext.Current.Request.QueryString["data"]);
            if (!string.IsNullOrEmpty(_QueryString))
            {
                Hashtable h1 = new Hashtable();
                h1.Add("id", _QueryString);

                HttpContext.Current.RewritePath("~/User/LargeImage.aspx?data=" + CommonShared.EncryptQueryString(h1), false);
            }
            else
            {
                Hashtable h1 = new Hashtable();
                h1.Add("id", _QueryString);

                HttpContext.Current.RewritePath("~/User/LargeImage.aspx?data=" + CommonShared.EncryptQueryString(h1), false);
            }
        }
        #endregion

        #region URL rewriting for Tell A Frnd list
        else if (strPath.Contains("/TellAFriend.aspx"))
        {
            HttpContext.Current.RewritePath("~/User/Email.aspx", false);
        }
        #endregion

        #region URL Rewriting for login Page
        else if (strPath.Contains("/Login.aspx"))
        {
            string _query = Convert.ToString(HttpContext.Current.Request.QueryString);
            HttpContext.Current.RewritePath("~/User/Login.aspx?" + _query, false);
        }
        #endregion

        #region URL Rewriting For Product Promotions
        else if (strPath.Contains("/Best_Features.aspx"))
        {
            HttpContext.Current.RewritePath("~/User/BestFeatures.aspx?Key=Best", false);
        }
        else if (strPath.Contains("/Monthly_Special.aspx"))
        {
            HttpContext.Current.RewritePath("~/User/BestFeatures.aspx?Key=Month", false);
        }
        else if (strPath.Contains("/New_Year_Special.aspx"))
        {
            HttpContext.Current.RewritePath("~/User/BestFeatures.aspx?Key=Year", false);
        }
        else if (strPath.Contains("/Hot_Items.aspx"))
        {
            HttpContext.Current.RewritePath("~/User/BestFeatures.aspx?Key=Hot", false);
        }
        #endregion

        #region URL Rewriting For Others
        else
        {
            #region URL Rewriting For Category List
            if (strPath.Contains("/Category/"))
            {
                //string _QueryString = strPath.Replace("/Category/", string.Empty);
                //string _QueryString = strPath.IndexOf("/Category/");

                string _QueryString = strPath.Substring(strPath.IndexOf("/Category/")).Replace("/Category/", string.Empty);

                if (!string.IsNullOrEmpty(_QueryString))
                {
                    if (_QueryString.Contains(".aspx"))
                    {
                        string   _PostedURL = _QueryString;
                        string[] redirect   = _QueryString.Split('/');
                        _QueryString = redirect[redirect.Length - 1];

                        DataTable table = URLCheck.CheckForCategory(_QueryString.Replace("_", " ").Replace(".aspx", string.Empty));
                        if (table.Rows.Count > 0)
                        {
                            Hashtable h1 = new Hashtable();
                            h1.Add("id", table.Rows[0]["CategoryIdName"]);
                            HttpContext.Current.RewritePath("~/User/CategoryList.aspx?data=" + CommonShared.EncryptQueryString(h1) + "&PostURL=" + _PostedURL, false);
                        }
                        else
                        {
                            Hashtable h1 = new Hashtable();
                            h1.Add("id", 0);
                            HttpContext.Current.RewritePath("~/User/CategoryList.aspx?data=" + CommonShared.EncryptQueryString(h1), false);
                        }
                    }
                }
            }
            #endregion

            #region URL Rewriting Products
            if (strPath.Contains("/Products/"))
            {
                //string _QueryString = strPath.Replace("/ECommerce/Products/", string.Empty);

                string _QueryString = strPath.Substring(strPath.IndexOf("/Products/")).Replace("/Products/", string.Empty);

                if (!string.IsNullOrEmpty(_QueryString))
                {
                    if (_QueryString.Contains(".aspx"))
                    {
                        string[] redirect = _QueryString.Split('/');
                        _QueryString = redirect[redirect.Length - 1];

                        DataTable table = URLCheck.CheckForCategory(_QueryString.Replace("_", " ").Replace(".aspx", string.Empty));
                        if (table.Rows.Count > 0)
                        {
                            Hashtable h1 = new Hashtable();
                            h1.Add("id", table.Rows[0]["CategoryIdName"]);
                            HttpContext.Current.RewritePath("~/User/ProductList.aspx?data=" + CommonShared.EncryptQueryString(h1), false);
                        }
                        else
                        {
                            Hashtable h1 = new Hashtable();
                            h1.Add("id", 0);
                            HttpContext.Current.RewritePath("~/User/ProductList.aspx?data=" + CommonShared.EncryptQueryString(h1), false);
                        }
                    }
                }
            }
            #endregion

            #region URL Rewriting Product Details
            if (strPath.Contains("/ProductDetails/"))
            {
                //string _QueryString = strPath.Replace("/ECommerce/ProductDetails/", string.Empty);

                string _QueryString = strPath.Substring(strPath.IndexOf("/ProductDetails/")).Replace("/ProductDetails/", string.Empty);

                if (!string.IsNullOrEmpty(_QueryString))
                {
                    if (_QueryString.Contains(".aspx"))
                    {
                        string[] redirect = _QueryString.Split('/');
                        _QueryString = redirect[redirect.Length - 1];

                        DataTable table = URLCheck.CheckForProductList(_QueryString.Replace("_", " ").Replace(".aspx", string.Empty));
                        if (table.Rows.Count > 0)
                        {
                            Hashtable h1 = new Hashtable();
                            h1.Add("id", table.Rows[0]["ProductIdName"]);
                            HttpContext.Current.RewritePath("~/User/ProductDetails.aspx?data=" + CommonShared.EncryptQueryString(h1), false);
                        }
                        else
                        {
                            Hashtable h1 = new Hashtable();
                            h1.Add("id", 0);
                            HttpContext.Current.RewritePath("~/User/ProductDetails.aspx?data=" + CommonShared.EncryptQueryString(h1), false);
                        }
                    }
                }
            }
            #endregion
        }
        #endregion
    }