Пример #1
0
        private void StartLoadSubOtherInfo(int id)
        {
            string tag = __tag + "[StartLoadSubOtherInfo]";

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

            lbError.Visible = false;

            try
            {
                var result = OtherDAL.Get(id);
                if (result.Code < 0)
                {
                    lbError.InnerText = result.ErrorMessage;
                    lbError.Visible   = true;

                    return;
                }

                OtherBOL other = new OtherBOL(result.Data.Tables[0].Rows[0]);
                tbxNameVN.Text = other.Name_VN;
                tbxNameEN.Text = other.Name_EN;
                tbxLink.Text   = other.Link;
                if (!string.IsNullOrEmpty(other.ImageLink))
                {
                    //imgImage.ImageUrl = "~/" + Path.Combine(Utilities.GetDirectory("ImagesDir"), other.ImageLink.Split('|')[0]);
                    //imgImage.Visible = true;
                    //---
                    groupImages.Visible = true;
                    StartLoadImages(other.ImageLink);
                }
                else
                {
                    //imgImage.Visible = false;
                    groupImages.Visible = false;
                }
                tbxDesVN.Text = other.Description_VN;
                tbxDesEN.Text = other.Description_EN;

                btnSubmit.Text    = "Update";
                btnCancel.Visible = true;
            }
            catch (Exception ex)
            {
                LogHelpers.WriteException(tag, ex.ToString());

                lbError.InnerText = ex.Message;
                lbError.Visible   = true;
            }
            finally
            {
                LogHelpers.WriteStatus(tag, "End.");
            }
        }
Пример #2
0
        private void StartLoadOtherGroupInfo(int id)
        {
#if DEBUG
            _log.Debug("id: {0}", id);
#endif
            lbError.Visible = false;

            try
            {
                var result = OtherDAL.Get(id);
                if (result.Code < 0)
                {
                    lbError.InnerText = result.ErrorMessage;
                    lbError.Visible   = true;
                    return;
                }

                OtherBOL otherType = new OtherBOL(result.Data.Tables[0].Rows[0]);
                hfId.Value     = otherType.Id.ToString();
                tbxNameVN.Text = otherType.Name_VN;
                tbxNameEN.Text = otherType.Name_EN;
                tbxDesVN.Text  = otherType.Description_VN;
                tbxDesEN.Text  = otherType.Description_EN;

                tbxNameEN.Enabled = true;
                tbxNameVN.Enabled = true;
                //---
                //btnSubmit.Text = "Update";
                //btnCancel.Visible = true;
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
                lbError.InnerText = ex.Message;
                lbError.Visible   = true;
            }
        }