Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         PriceMasterList1.DataBind();
     }
 }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack || string.IsNullOrEmpty(Request.QueryString["Id"]))
            {
                return;
            }

            Distributor d = ControllerManager.Distributor.GetById(Convert.ToInt32(Request.QueryString["Id"]));

            if (d != null && d.PriceList != null)
            {
                PublishList pl = ControllerManager.PublishList.GetCurrentList(d.PriceList.ID);
                if (pl != null)
                {
                    PriceMasterList1.PublishListID = pl.ID;
                }

                PriceMasterList1.DistributorID = d.ID;
                PriceMasterList1.DataBind();
            }
            else
            {
                PriceMasterList1.Visible = false;
                lblNoPriceList.Visible   = true;
            }
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack && !string.IsNullOrEmpty(Request.QueryString["Id"]))
     {
         PriceMasterList1.PriceListID = Convert.ToInt32(Request.QueryString["Id"]);
         PriceMasterList1.DataBind();
     }
 }
Ejemplo n.º 4
0
        public override void DataBind()
        {
            if (!Page.IsPostBack)
            {
                PriceMasterList1.DataBind();
            }

            base.DataBind();
        }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack && !string.IsNullOrEmpty(Request.QueryString["Id"]))
     {
         int categoryId = Convert.ToInt32(Request.QueryString["Id"]);
         PriceMasterList1.CatalogPageID   = categoryId;
         PriceMasterList1.UrlForCreateNew = "/pagelist/childs/create/default.aspx?id=" + categoryId;
         PriceMasterList1.DataBind();
     }
 }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack && !string.IsNullOrEmpty(Request.QueryString["id"]))
     {
         PriceMasterList1.ProductId = Convert.ToInt32(Request.QueryString["id"]);
         PriceMasterList1.DataBind();
         MenuItem mu = MenuItem.FindMenu(this.Page.AppRelativeVirtualPath);
         if (mu != null)
         {
             Page.Title += " - " + mu.Description;
         }
     }
 }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack || string.IsNullOrEmpty(Request.QueryString["Id"]))
            {
                return;
            }

            Provider p = ControllerManager.Provider.GetById(Convert.ToInt32(Request.QueryString["Id"]));

            if (p != null)
            {
                PriceMasterList1.ProviderId = p.ID;
                PriceMasterList1.DataBind();
            }
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack && !string.IsNullOrEmpty(Request.QueryString["Id"]))
            {
                PublishList pl =
                    ControllerManager.PublishList.GetPublishedList(Convert.ToInt32(Request.QueryString["Id"]));

                if (pl != null)
                {
                    PriceMasterList1.PublishListID = pl.ID;
                }
                if (!string.IsNullOrEmpty(Request.QueryString["CatalogPageId"]))
                {
                    PriceMasterList1.CatalogPageID = Convert.ToInt32(Request.QueryString["CatalogPageId"]);
                }
                PriceMasterList1.DataBind();
            }
        }
Ejemplo n.º 9
0
        public override void DataBind()
        {
            //if (Page.IsPostBack)
            {
                lblTitle.Text = "Nueva Cotización";
                ddlQuoteIntroText.DataSource     = ControllerManager.Lookup.List(LookupType.QuoteIntroText);
                ddlQuoteIntroText.DataTextField  = "Title";
                ddlQuoteIntroText.DataValueField = "ID";
                ddlQuoteIntroText.DataBind();
                ddlQuoteIntroText.Items.Insert(0, new ListItem("--Texto Introductorio--", "0"));

                ddlQuoteCondition.DataSource     = ControllerManager.Lookup.List(LookupType.QuoteCondition);
                ddlQuoteCondition.DataTextField  = "Title";
                ddlQuoteCondition.DataValueField = "ID";
                ddlQuoteCondition.DataBind();
                ddlQuoteCondition.Items.Insert(0, new ListItem("--Condición--", "0"));

                ddlQuoteVigency.DataSource     = ControllerManager.Lookup.List(LookupType.QuoteVigency);
                ddlQuoteVigency.DataTextField  = "Description";
                ddlQuoteVigency.DataValueField = "ID";
                ddlQuoteVigency.DataBind();

                ddlToCurrency.DataSource     = ControllerManager.Currency.GetAll();
                ddlToCurrency.DataTextField  = "Description";
                ddlToCurrency.DataValueField = "ID";
                ddlToCurrency.DataBind();

                PriceMasterList1.AllowMultipleSelection = true;

                if (PriceMasterList1.GridHelper == null)
                {
                    PriceMasterList1.GridHelper = new GridHelper();
                    PriceMasterList1.GridHelper.SortAscending = true;
                }

                PriceMasterList1.GridHelper.PageSize = 10;

                LoadFields();

                PriceMasterList1.DataBind();

                SetVisibility();
            }
        }
Ejemplo n.º 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         PriceMasterList1.RecreateFromJavascript();
         foreach (int item in PriceMasterList1.GridState.Items)
         {
             PriceBase  pb = ControllerManager.PriceBase.GetById(item);
             HtmlAnchor a  = new HtmlAnchor();
             a.InnerText             = "[x]";
             a.Attributes["class"]   = "removeItem";
             a.Attributes["onclick"] = "removeItem()";
             HtmlGenericControl h3 = new HtmlGenericControl("h3");
             if (string.IsNullOrEmpty(pb.Product.Code))
             {
                 h3.InnerText = pb.ProviderCode;
             }
             else
             {
                 h3.InnerText = pb.Product.Code;
             }
             HtmlGenericControl p = new HtmlGenericControl("p");
             p.InnerText = pb.Product.Model;
             HtmlGenericControl li = new HtmlGenericControl("li");
             li.Attributes["id"] = pb.ID.ToString();
             li.Controls.Add(a);
             li.Controls.Add(h3);
             li.Controls.Add(p);
             productlist.Controls.Add(li);
         }
     }
     else
     {
         //[BUG]: Se debe setear el foco primero en otro control, para que funcione de primera el
         //buscador de Ajax
         AjaxControlToolkit.Utility.SetFocusOnLoad(txtObservations);
         AjaxControlToolkit.Utility.SetFocusOnLoad(txtDistributor);
     }
 }