Esempio n. 1
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.slide   bll   = new BLL.slide();
            Model.slide model = bll.GetModel(_id);

            model.title      = txtTitle.Text.Trim();
            model.link_url   = txtLinkUrl.Text.Trim();
            model.img_url    = txtImgUrl.Text.Trim();
            model.brand_id   = Utils.StrToInt(ddlBrand.SelectedValue, 0);
            model.start_time = Utils.StrToDateTime(txtStartTime.Text.Trim());
            DateTime _end_time;

            if (DateTime.TryParse(txtEndTime.Text.Trim(), out _end_time))
            {
                model.end_time = _end_time;
            }
            model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99);

            if (bll.Update(model))
            {
                AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改Banner:" + model.title); //記錄日誌
                result = true;
            }

            return(result);
        }
Esempio n. 2
0
        private void ShowInfo(int _id)
        {
            BLL.slide   bll   = new BLL.slide();
            Model.slide model = bll.GetModel(_id);

            pic                    = model.img_url;
            txtTitle.Text          = model.title;
            txtLinkUrl.Text        = model.link_url;
            txtImgUrl.Text         = model.img_url;
            ddlBrand.SelectedValue = model.brand_id.ToString();
            txtStartTime.Text      = model.start_time.ToString("yyyy-M-d");
            if (model.end_time != null)
            {
                txtEndTime.Text = model.end_time.GetValueOrDefault().ToString("yyyy-M-d");
            }
            txtSortId.Text = model.sort_id.ToString();
        }