Esempio n. 1
0
        /// <summary>
        /// Fetch company services
        /// </summary>
        public void XmlFetchData()
        {
            string xmlFile = BaseSys.GetXmlFilePath("Category.xml"); 

            if (File.Exists(xmlFile))
            {
                category.ReadXml(xmlFile);
                var cateRows = (from c in category where c.Active == true select c).ToList();
                // Declare paged data source for pagging in repeater
                var _pagedDataSource = new PagedDataSource
                {
                    AllowCustomPaging = true,
                    AllowPaging = true,
                    PageSize = this.PageSize,
                    DataSource = cateRows.Skip((CurrentPageIndex - 1) * this.PageSize)
                };
                // Get the total pages
                decimal decimalPages = Decimal.Divide((decimal)cateRows.Count, (decimal)_pagedDataSource.PageSize);
                this.PageCount = (int)(Math.Ceiling(decimalPages));

                this.StylePageNagiation(cateRows.Count);

                repeaterData.DataSource = _pagedDataSource;
                repeaterData.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            xmlFile = BaseSys.GetXmlFilePath("Category.xml");

            //if (!IsPostBack)
            //    xmlFile = BaseSys.GetXmlFilePath("Category.xml");
        }
        // Initialize the box
        public void InitializeShowBox()
        {
            xmlFile = BaseSys.GetXmlFilePath("Category.xml");

            this.GetDataFromXml();
            this.LinqFetchXmlData();
        }
Esempio n. 4
0
        /// <summary>
        /// Fetch single row data that specified to giving cate
        /// </summary>
        /// <param name="id"></param>
        protected void XmlFetchContent(int id)
        {
            string xmlFile = BaseSys.GetXmlFilePath("Category.xml"); 

            if (File.Exists(xmlFile))
            {
                XDocument xmlDoc = XDocument.Load(xmlFile);
                var cate = xmlDoc.Descendants("Category").FirstOrDefault(c => c.Element("Id").Value == id.ToString());

                if (cate == null) return;

                lbTitle.Text = cate.Element("Name").Value;
                lbDescription.Text = cate.Element("Description").Value;
                imgShow.ImageUrl = cate.Element("ImagePath").Value;

                Page.Title = string.Format("{0} - {1}", Properties.Resources.MainTitle, cate.Element("Name").Value);

                //category.ReadXml(xmlFile);
                //var content = (from c in category where c.Id == id select c).First();

                //lbTitle.Text = content.Name;
                //lbDescription.Text = content.Description;
                //imgShow.ImageUrl = content.ImagePath;

                //// Make the title as page title
                //Page.Title = string.Format("{0} - {1}", Properties.Resources.MainTitle, content.Name);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     xmlFile = BaseSys.GetXmlFilePath("Website.xml"); // !Important - Multilingual resource
     if (!IsPostBack)
     {
         this.XmlFetchRowData();
         mwcAsyncImageUpload.UploadTitle = Properties.Resources.LogoImageUpload;
     }
 }
Esempio n. 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     xmlFile = BaseSys.GetXmlFilePath("Category.xml"); // !Important - Multilingual resource
     if (!IsPostBack)
     {
         mwcAsyncImageUpload.DestinationFolder = "Category/";
         mwcAsyncImageUpload.UploadTitle = Properties.Resources.CategoryImageUpload;
     }
 }
        /// <summary>
        /// Fetch company categories
        /// </summary>
        public void XmlFetchData()
        {
            string xmlFile = BaseSys.GetXmlFilePath("Category.xml");
            if (File.Exists(xmlFile))
            {
                category.ReadXml(xmlFile);

                repeaterData.DataSource = category.Take(3);
                repeaterData.DataBind();
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Fetch company services
        /// </summary>
        public void XmlFetchData()
        {
            string xmlFile = BaseSys.GetXmlFilePath("");
            if (File.Exists(xmlFile))
            {
                holder.ReadXml(xmlFile);

                repeaterData.DataSource = holder;
                repeaterData.DataBind();
            }
        }
Esempio n. 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int count = smartDb.SysUsers.Count();
         if (count > 0) this.Visible = true; else { this.Visible = false; this.ShowNewUser(); }
         string xmlFile = BaseSys.GetXmlFilePath("Company.xml"); ddlLanguage.Items.Clear();
         SharedLinq.XmlFetchLanguage(ddlLanguage);
         ddlLanguage.ClearSelection();
         ddlLanguage.Items.FindByValue(this.CultureInfo).Selected = true;
     }
 }
Esempio n. 10
0
        /// <summary>
        /// Count data found that specified to giving cate
        /// </summary>
        /// <param name="id"></param>
        protected void LinqCountRows(int id)
        {
            string xmlFile = BaseSys.GetXmlFilePath("Category.xml"); 
            category.ReadXml(xmlFile);
            int count = (from c in category where c.Id == id select c).Count();

            if (count > 0)
            {
                msgPanel.Visible = false;
                contentPanel.Visible = true;
                this.XmlFetchContent(id);
            }
        }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string xmlFile = BaseSys.GetXmlFilePath("Company.xml");
            if (!IsPostBack)
            {
                SharedLinq.XmlFetchLanguage(ddlLanguage);
                ddlLanguage.Items.FindByValue(this.CultureInfo).Selected = true;
                this.PrivilegedUser();

                if (BaseSys.LogInControlPanel == true)
                    this.UserInfo();
            }
        }
Esempio n. 12
0
 // Fetch row data from xml using xml dataset
 protected void XmlFetchRowData()
 {
     string xmlFile = BaseSys.GetXmlFilePath("Home.xml");
     if (File.Exists(xmlFile))
     {
         // Get data from xml file
         home.ReadXml(xmlFile);
         row = (Company.HomeRow)home.Rows[0];
         lbTitle.Text = row.Title;
         lbInformation.Text = row.Information;
         lbVision.Text = row.Vision;
         lbMission.Text = row.Mission;
     }
 }
        // Fetch row data from xml using xml dataset
        protected void XmlFetchRowData()
        {
            string xmlFile = BaseSys.GetXmlFilePath("About.xml");

            if (File.Exists(xmlFile))
            {
                // Get data from xml file
                about.ReadXml(xmlFile);
                row = (Company.AboutRow)about.Rows[0];
                lbWhoAreWe.Text = row.WhoAreWe;
                lbManager.Text = string.Format("{0}: {1}", Properties.Resources.Manager, row.Manager);
                lbProfile.Text = row.Profile;
            }
        }
Esempio n. 14
0
        // Fetch row data from xml using xml dataset
        protected void XmlFetchRowData()
        {
            string xmlFile = BaseSys.GetXmlFilePath("Contact.xml");

            if (File.Exists(xmlFile))
            {
                // Get data from xml file
                contact.ReadXml(xmlFile);
                row = (Company.ContactUsRow)contact.Rows[0];

                lbContact.Text = string.Format("{0}: {1} | {2}: {3}", Properties.Resources.Phone, row.Phone, Properties.Resources.Fax, row.Fax);
                lbMobile.Text = string.Format("{0}: {1}", Properties.Resources.Mobile, row.Mobile);
                lbEmail.Text = string.Format("{0}: {1}", Properties.Resources.Email, row.Email);
                lbAddress.Text = string.Format("{0}: {1}", Properties.Resources.Address, row.Address);
            }
        }
Esempio n. 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     xmlFile = BaseSys.GetXmlFilePath("Home.xml"); // !Important - Multilingual resource
     if (!IsPostBack)
         this.XmlFetchRowData();
 }
Esempio n. 16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     xmlFile = BaseSys.GetXmlFilePath("Category.xml"); // Important - otherwise will have error
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     xmlFile = BaseSys.GetXmlFilePath("Website.xml");
     if (!IsPostBack)
         this.XmlFetchRowData();
 }
Esempio n. 18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     xmlFile = BaseSys.GetXmlFilePath("Category.xml"); // !Important - Multilingual resource
     if (!IsPostBack)
         this.LinqCountDataComponent();
 }