Beispiel #1
0
 protected void Page_Init(object sender, EventArgs e)
 {
     if (!SuppliersSessionHelper.IsProductSupplier())
     {
         Response.Redirect("404.aspx");
     }
 }
Beispiel #2
0
 public void CheckAuthenticated()
 {
     if (!_IsAuthenticated)
     {
         _IsAuthenticated = SuppliersSessionHelper.IsAuthenticated();
         if (_IsAuthenticated == true)
         {
             HasHelloExit         = true;
             HasHomePage          = true;
             HasMyProfile         = true;
             HasProductManegement = true;
             HasDealsHistory      = true;
         }
         if (!SuppliersSessionHelper.IsProductSupplier())
         {
             HasHomePage          = false;
             HasMyProfile         = true;
             HasProductManegement = false;
             HasDealsHistory      = false;
             HasClicksHistory     = true;
         }
         if (!_IsAuthenticated && !Request.Url.AbsoluteUri.Contains("Contact.aspx"))
         {
             Response.Redirect(@"/Login.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.Url.PathAndQuery), true);
         }
     }
 }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!SuppliersSessionHelper.IsProductSupplier())
     {
         LinkButtonHistory.Visible  = false;
         LinkButtonProducts.Visible = false;
     }
     else
     {
         LinkButtonClicks.Visible = false;
     }
 }
Beispiel #4
0
    //protected void NumericOnly_ServerValidate(object source, ServerValidateEventArgs args)
    //{
    //    string pattern = @"^[0-9]*$";

    //    Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
    //    bool result = true;
    //    string[] arr = hfProductIds.Value.Split(',');

    //    foreach (DataGridItem item in dgProducts.Items)
    //    {
    //        if (result)
    //        {
    //            object obj = dgProducts.DataKeys[item.ItemIndex];
    //            if (obj != null && !arr.Contains(obj.ToString())) continue;
    //            TextBox txtPrice = item.FindControl("txtPrice") as TextBox;

    //            MatchCollection matches = rgx.Matches(txtPrice.Text);
    //            if (matches.Count == 0 && txtPrice.Text != "") result = false;

    //            if (result == false)
    //            {
    //                args.IsValid = result;
    //                Master.MessageCenter.DisplayErrorMessage(ProductsStrings.GetText(@"NumericOnly"));

    //                // txtPrice.Text = ProductsStrings.GetText(@"NumericOnly");
    //            }
    //        }

    //    }

    //}

    protected void btnImport_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }
        if (!SuppliersSessionHelper.IsProductSupplier())
        {
            return;
        }
        if (SuppliersSessionHelper.SupplierId() == 0)
        {
            return;
        }

        Response.Redirect(@"ImportProductsForSupplier.aspx", true);
    }