Exemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            // Lấy giá trị
            AboutUs _obj = new AboutUs();

            _obj.IntroID     = this.txtIntroID.Text == "" ? 0 : Convert.ToInt32(this.txtIntroID.Text);
            _obj.Description = this.ckeDescription.Text;
            _obj.Active      = this.chkActive.Checked;
            _obj.CreateDate  = DateTime.Now;
            _obj.CreateUser  = "******";
            _obj.EditDate    = DateTime.Now;
            _obj.EditUser    = "******";

            // Xóa Active đang tồn tại nếu Active Edit = True
            // đảm bảo chỉ cho một nội dụng được Active
            if (_obj.Active == true)
            {
                AboutUs.ResetActive();
            }

            // Lưu xuống dữ liệu
            if (M_Mode.Mode == Modes.EDIT)
            {
                AboutUs.Update(_obj);
            }
            else if (M_Mode.Mode == Modes.INSERT)
            {
                AboutUs.Insert(_obj);
            }

            // Mở lại trang AboutUsManage
            Response.Redirect(@"~\App_WebAdmins\AboutUsManage.aspx");
        }