示例#1
0
        public void StartLoadAboutDetail()
        {
            string tag = "[ucAbout][StartLoadAboutDetail]";

            var result = AboutsDAL.Get();

            if (result.Code < 0)
            {
                lbError.InnerText = result.ErrorMessage;
                lbError.Visible   = true;
                return;
            }

            lbError.Visible = false;
            try
            {
                AboutBOL about = new AboutBOL(result.Data.Tables[0].Rows[0]);
                hfId.Value         = about.Id.ToString();
                tbxNameVN.Text     = about.Name_VN;
                tbxNameEN.Text     = about.Name_EN;
                tbxAddress.Text    = about.Address_VN;
                tbxAddressEN.Text  = about.Address_EN;
                tbxFax.Text        = about.Fax;
                tbxPhone.Text      = about.Phone;
                tbxEmail.Text      = about.Email;
                tbxGoogleCode.Text = about.GoogleMaps;
            }
            catch (Exception ex)
            {
                LogHelpers.WriteException(tag, ex.ToString());
                //---
                lbError.InnerText = ex.Message;
                lbError.Visible   = true;
            }
        }
示例#2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            AboutBOL obj = CreateAboutObject();
            //--
            var result = AboutsDAL.InsertOrUpdate(obj);

            if (result.Code < 0)
            {
                lbError.InnerText = result.ErrorMessage;
                lbError.Visible   = true;

                return;
            }

            lbError.Visible = false;
        }
示例#3
0
        private void GetLogo()
        {
            ResultBOL <DataSet> result = AboutsDAL.Get();

            if (result.Code < 0)
            {
                _log.Error(result.ErrorMessage);
            }
            else if (result.Data != null && result.Data.Tables.Count > 0 && result.Data.Tables[0].Rows.Count > 0)
            {
                AboutBOL about = new AboutBOL(result.Data.Tables[0].Rows[0]);
                if (!string.IsNullOrEmpty(about.ImageLink))
                {
                    this.imgLogo.Src = "~/" + Path.Combine(Utilities.GetDirectory("ImagesDir"), about.ImageLink);
                }
            }
        }
示例#4
0
        private void StartLoadContactInfo()
        {
            string tag = __tag + "[StartLoadContactInfo]";

            LogHelpers.WriteStatus(tag, "Start...");

            try
            {
                var result = AboutsDAL.GetAll();
                if (result.Code < 0)
                {
                    LogHelpers.WriteError(tag, result.ErrorMessage);
                }

                AboutBOL about = new AboutBOL(result.Data.Tables[0].Rows[0]);
                if (Utilities.IsLangueEN())
                {
                    lbName.InnerText        = about.Name_EN;
                    lbAddress.InnerText     = "Address:";
                    lbAddressInfo.InnerText = about.Address_EN;
                    lbPhone.InnerText       = "Phone:";
                }
                else
                {
                    lbName.InnerText        = about.Name_VN;
                    lbAddress.InnerText     = "Địa chỉ:";
                    lbAddressInfo.InnerText = about.Address_VN;
                    lbPhone.InnerText       = "Điện thoại:";
                }

                lbPhoneInfo.InnerText = about.Phone;
                lbFaxInfo.InnerText   = about.Fax;
                lbEmailInfo.InnerText = about.Email;
            }
            catch (Exception ex)
            {
                LogHelpers.WriteException(tag, ex.ToString());
            }
            finally
            {
                LogHelpers.WriteStatus(tag, "End.");
            }
        }
示例#5
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            AboutBOL obj = CreateAboutObject();

            if (!string.IsNullOrEmpty(obj.ImageLink))
            {
                imgImage.ImageUrl = "~/" + Path.Combine(Utilities.GetDirectory("ImagesDir"), obj.ImageLink);
            }
            //--
            var result = AboutsDAL.InsertOrUpdate(obj);

            if (result.Code < 0)
            {
                lbError.InnerText = result.ErrorMessage;
                lbError.Visible   = true;

                return;
            }

            lbError.Visible = false;
        }
示例#6
0
        public void StartLoadAboutDetail()
        {
            string tag = "[ucAbout][StartLoadAboutDetail]";

            var result = AboutsDAL.Get();

            if (result.Code < 0)
            {
                lbError.InnerText = result.ErrorMessage;
                lbError.Visible   = true;
                return;
            }

            lbError.Visible = false;
            try
            {
                AboutBOL about = new AboutBOL(result.Data.Tables[0].Rows[0]);
                hfId.Value         = about.Id.ToString();
                tbxNameVN.Text     = about.Name_VN;
                tbxNameEN.Text     = about.Name_EN;
                tbxAddress.Text    = about.Address_VN;
                tbxAddressEN.Text  = about.Address_EN;
                tbxFax.Text        = about.Fax;
                tbxPhone.Text      = about.Phone;
                tbxEmail.Text      = about.Email;
                tbxWebSite.Text    = about.WebSite;
                tbxGoogleCode.Text = about.GoogleMaps;
                if (!string.IsNullOrEmpty(about.ImageLink))
                {
                    imgImage.ImageUrl = "~/" + Path.Combine(Utilities.GetDirectory("ImagesDir"), about.ImageLink);
                }
            }
            catch (Exception ex)
            {
                LogHelpers.WriteException(tag, ex.ToString());
                //---
                lbError.InnerText = ex.Message;
                lbError.Visible   = true;
            }
        }