コード例 #1
0
        private void LoadGrid()
        {
            DB.DB_Object.AboutUs objClassData = new DB.DB_Object.AboutUs();
            DataTable            dt           = objClassData.getDataAboutUs();

            lblTotalRows.Text = dt.Rows.Count.ToString();
            _grid.DataSource  = dt;
            _grid.DataBind();
        }
コード例 #2
0
        // Load thông tin tên loại tin tức lên các combox VN
        protected void LoadComBoBoxTypeNewsVN()
        {
            DB.DB_Object.AboutUs AboutUs = new DB.DB_Object.AboutUs();
            DataTable            dt      = AboutUs.GetDataLoadComBoxVN();

            if (dt != null)
            {
                ListItem Item = new ListItem();
                Item.Text  = "----- Chọn Menu giới thiệu -----";
                Item.Value = "0";
                cboNameNewsVN.Items.Add(Item);
                foreach (DataRow dr in dt.Rows)
                {
                    ListItem newItem = new ListItem();
                    newItem.Text  = dr[1].ToString();
                    newItem.Value = dr[0].ToString();
                    cboNameNewsVN.Items.Add(newItem);
                }
            }
        }
コード例 #3
0
        // Load dữ lieu lên các TextBox tương ứng
        private void LoadTextBox()
        {
            int intID = 0;

            if (CommonClass.StringValidator.IsNumber(Request["ChilAboutUsID"].ToString().Trim()))
            {
                intID = int.Parse(Request["ChilAboutUsID"].ToString().Trim());
            }

            DB.DB_Object.AboutUs objClassData = new DB.DB_Object.AboutUs();
            DataTable            dt           = objClassData.getDataEditAboutUs(intID);

            foreach (DataRow dr in dt.Rows)
            {
                txtChilAboutUsID.Text       = dr["chilAboutUsID"].ToString();
                cboNameNewsVN.SelectedValue = dr["chilAboutUsID"].ToString();
                txtContentEL.Value          = dr["ContentEL"].ToString();
                //txtContentVN. = dr["ContentVN"].ToString();
            }
        }
コード例 #4
0
        // Update mới thông tin một News...
        private void Update()
        {
            try
            {
                int    intNewsID    = int.Parse(txtChilAboutUsID.Text.Trim());
                string strContentEL = objClassDataCommon.FilterSQLParamater(txtContentEL.Value.Trim());
                string strContentVN = objClassDataCommon.FilterSQLParamater(txtContentVN.Value.Trim());

                DB.DB_Object.AboutUs objClassData = new DB.DB_Object.AboutUs();
                if (objClassData.UpdateAboutUs(intNewsID, strContentEL, strContentVN) == true)
                {
                    Response.Redirect("~/Amincp/ManagerAboutUs.aspx");
                }
                else
                {
                    CommonClass.MessageBox.Show("Lỗi kết nối đến Server. Vui lòng kiểm tra hệ thống mạng!");
                }
            }
            catch (Exception e)
            {
                SetErrorMessage(e.Message);
            }
        }