Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    if (m_isPassOnce)
                    {
                        return;
                    }
                    aLinkUpload.HRef = m_linkUpload;

                    //Set DisplayDate to Today, Set ExpiredDate to ten years after.
                    this.txtDisplayDate.Text = DateTime.Now.ToString("dd/MM/yyyy");
                    this.txtExpiredDate.Text = DateTime.Now.AddYears(10).ToString("dd/MM/yyyy");

                    //Load Categories
                    //if (m_Serviced == -1)
                    //{
                    this.chkCategoryList.DataSource     = DataProcessingProvider.ProcessDataTable(CategoryProvider.GetExcludedCategories(this.PortalId, -1, ServiceProvider.TypeId), 1, 2);
                    this.chkCategoryList.DataTextField  = "Name";
                    this.chkCategoryList.DataValueField = "CategoryId";
                    this.chkCategoryList.DataBind();
                    UIProvider.BindListBox(chkCategoryList, m_strCategories);
                    //}
                    //else
                    //{
                    //    TH.Core.Providers.Utilities.UIProvider.PopulateCategories(this.chkCategoryList, m_strCategories, ServiceProvider.TypeId, this.UserId, GetSuperMode(), true, m_Serviced);

                    //}
                    //Bind Data
                    if (m_Serviced != -1)
                    {
                        ImageBinding();
                    }


                    m_isPassOnce = true;
                }
            }
            catch (Exception ex)
            {
                lblError.Text         = ex.Message;
                this.lblError.Visible = true;
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    if (m_isPassOnce)
                    {
                        return;
                    }

                    //Set DisplayDate to Today, Set ExpiredDate to ten years after.
                    this.txtDisplayDate.Text = DateTime.Now.ToString("dd/MM/yyyy");
                    this.txtExpiredDate.Text = DateTime.Now.AddYears(10).ToString("dd/MM/yyyy");

                    this.txtProducedDate.Text = DateTime.Now.AddYears(10).ToString("dd/MM/yyyy");


                    txtWeight.Text   = "0";
                    txtPrice.Text    = "0";
                    txtPriceOld.Text = "0";
                    txtOrder.Text    = "100";

                    //Load Categories
                    //if (m_ProductId == -1)
                    //{
                    this.chkCategoryList.DataSource     = DataProcessingProvider.ProcessDataTable(CategoryProvider.GetExcludedCategories(this.PortalId, -1, ProductProvider.TypeId), 1, 2);
                    this.chkCategoryList.DataTextField  = "Name";
                    this.chkCategoryList.DataValueField = "CategoryId";
                    this.chkCategoryList.DataBind();
                    UIProvider.BindListBox(chkCategoryList, m_strCategories);

                    //Tag
                    this.chkTags.DataSource     = DotNetNuke.Data.DataProvider.Instance().ExecuteDataSet("THCore_CM_GetTags", this.PortalId, 3).Tables[0];
                    this.chkTags.DataTextField  = "Name";
                    this.chkTags.DataValueField = "TagID";
                    this.chkTags.DataBind();
                    UIProvider.BindListBox(chkTags, m_strTags);

                    //}
                    //else
                    //{
                    //    TH.Core.Providers.Utilities.UIProvider.PopulateCategories(this.chkCategoryList, m_strCategories, ProductProvider.TypeId, this.UserId, GetSuperMode(), true, m_ProductId);

                    //}
                    //Bind Data
                    if (m_ProductId != -1)
                    {
                        ProductBinding();
                    }


                    m_isPassOnce = true;
                }
            }
            catch (Exception ex)
            {
                lblError.Text         = ex.Message;
                this.lblError.Visible = true;
            }
        }