protected void grvNgonNgu_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName != "Page")
     {
         GridViewRow gvr;
         gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
         int index = gvr.RowIndex;
         if (e.CommandName == "Sua")
         {
             GridViewRow gvrow = grvNgonNgu.Rows[index];
             typemodal.Value = "NN";
             editType.Value  = "edit"; //đoạn này
             hdId.Value      = grvNgonNgu.DataKeys[index].Value.ToString();
             NgonNgu nn = ngbll.LayNgonNgu(hdId.Value);
             txtTen.Text = nn.TenNgonNgu;
         }
         else
         if (e.CommandName == "Xoa")
         {
             GridViewRow gvrow = grvNgonNgu.Rows[index];
             string      id    = HttpUtility.HtmlDecode(gvrow.Cells[0].Text).ToString();
             editType.Value = "edit";
             idDelete.Value = id;
             Delete.Value   = "NN";
             ngbll.Xoa(id);
             typemodal.Value = "hide";
             LoadNN();
         }
     }
 }
Exemple #2
0
        public ReturnResult <NgonNgu> EditNgonNgu(NgonNgu NgonNgu)
        {
            ReturnResult <NgonNgu> result;
            DbProvider             db;

            try
            {
                result = new ReturnResult <NgonNgu>();
                db     = new DbProvider();
                db.SetQuery("NgonNgu_EDIT", CommandType.StoredProcedure)
                .SetParameter("NgonNguID", SqlDbType.Int, NgonNgu.NgonNguId, ParameterDirection.Input)
                .SetParameter("TenNgonNgu", SqlDbType.NVarChar, NgonNgu.TenNgonNgu, 50, ParameterDirection.Input)
                .SetParameter("ErrorCode", SqlDbType.Int, DBNull.Value, ParameterDirection.Output)
                .SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output)
                .ExcuteNonQuery()
                .Complete();
                db.GetOutValue("ErrorCode", out string errorCode)
                .GetOutValue("ErrorMessage", out string errorMessage);
                if (errorCode.ToString() == "0")
                {
                    result.ErrorCode    = "0";
                    result.ErrorMessage = "";
                }
                else
                {
                    result.Failed(errorCode, errorMessage);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Exemple #3
0
        public ReturnResult <NgonNgu> GetNgonNguByID(int NgonNguId)
        {
            var        result     = new ReturnResult <NgonNgu>();
            NgonNgu    item       = new NgonNgu();
            DbProvider dbProvider = new DbProvider();
            string     outCode    = String.Empty;
            string     outMessage = String.Empty;
            int        totalRows  = 0;

            try
            {
                dbProvider.SetQuery("NgonNgu_GET_BY_ID", CommandType.StoredProcedure)
                .SetParameter("NgonNguID", SqlDbType.Int, NgonNguId, ParameterDirection.Input)
                .SetParameter("ErrorCode", SqlDbType.NVarChar, DBNull.Value, 100, ParameterDirection.Output)
                .SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output)
                .GetSingle <NgonNgu>(out item)
                .Complete();
            }
            catch (Exception ex)
            {
                throw;
            }
            dbProvider.GetOutValue("ErrorCode", out outCode)
            .GetOutValue("ErrorMessage", out outMessage);

            return(new ReturnResult <NgonNgu>()
            {
                Item = item,
                ErrorCode = outCode,
                ErrorMessage = outMessage,
                TotalRows = totalRows
            });
        }
Exemple #4
0
 public bool sua(NgonNgu n)
 {
     if (string.IsNullOrEmpty(n.maNN))
     {
         return(false);
     }
     ngonNgu.update(n);
     return(true);
 }
        public bool insert(NgonNgu n)
        {
            if (dataTable("select * from NGONNGU where MaNN ='" + n.maNN + "'").Rows.Count > 0)
            {
                return(false);
            }
            string sqlCommand = string.Format("insert into NGONNGU values ('{0}',N'{1}')", n.maNN, n.tenNN);

            Excute(sqlCommand);
            return(true);
        }
Exemple #6
0
        public async Task <int> Xoa(int id)
        {
            NgonNgu ngonngu = _context.NgonNgus.Where(a => a.ID_NgonNgu == id).FirstOrDefault();

            if (ngonngu == null)
            {
                throw new Exception("Ngôn ngữ không tồn tại.");
            }
            ngonngu.Delete = true;
            _context.NgonNgus.Update(ngonngu);
            await _context.SaveChangesAsync();

            return(ngonngu.ID_NgonNgu);
        }
        public List <NgonNgu> searchNgonNgu(string key)
        {
            DataProvider   datap = new DataProvider();
            List <NgonNgu> list  = new List <NgonNgu>();
            string         query = "Select * from NgonNgu where MaNgonNgu like '" + key + "%'";
            DataTable      data  = datap.ExecuteQuery(query);

            foreach (DataRow item in data.Rows)
            {
                NgonNgu nn = new NgonNgu(item);
                list.Add(nn);
            }
            return(list);
        }
        public List <NgonNgu> GetListNgonNgu()
        {
            DataProvider   datap = new DataProvider();
            List <NgonNgu> list  = new List <NgonNgu>();
            string         query = "Select * from NgonNgu";
            DataTable      data  = datap.ExecuteQuery(query);

            foreach (DataRow item in data.Rows)
            {
                NgonNgu nn = new NgonNgu(item);
                list.Add(nn);
            }
            return(list);
        }
Exemple #9
0
 //hàm sửa thì có thể coppy nguyên hàm tên và đổi tên store
 public int Sua(NgonNgu nn)
 {
     SqlParameter[] parm = new SqlParameter[] {
         new SqlParameter(PARM_MANGONNGU, SqlDbType.NVarChar, 30),
         new SqlParameter(PARM_TENNGONNGU, SqlDbType.NVarChar, 30)
         //khai báo thứ tự như trong cái store đó
         //(-thuộc tính thứ nhất lấy từ tên khai báo ở trên-tiếp theo là kiểu dữ liệu-tiếp nữa là độ dài kiểu dữ liệu)
         //nếu là kiểu dữ liệu k có độ dài thì mình bỏ cái thuộc tính thứ 3 ví dụ như new sqlparameter(PARM_....,SqlDbType.Int)
     };
     parm[0].Value = nn.MaNgonNgu;
     parm[1].Value = nn.TenNgonNgu;
     //chỗ này thì phải truyền đúng theo thứ tự khai báo ở trên
     return(DALHelper.ExecuteNonQuery(DALHelper.ConnectionString, CommandType.StoredProcedure, "tblNgonNgu_Sua", parm));
 }
Exemple #10
0
        public async Task <int> Them(NgonNguRequest model)
        {
            NgonNgu ngonngu = new NgonNgu();

            ngonngu.ModifyBy   = model.ModifyBy;
            ngonngu.CreateBy   = model.CreateBy;
            ngonngu.Delete     = model.Delete;
            ngonngu.ID_NgonNgu = model.ID_NgonNgu;
            ngonngu.TenNgonNgu = model.TenNgonNgu;
            ngonngu.CreateDate = DateTime.Now;
            _context.NgonNgus.Add(ngonngu);
            await _context.SaveChangesAsync();

            return(ngonngu.ID_NgonNgu);
        }
        public NgonNgu GetListNgonNguByMaSach(string maSach)
        {
            DataProvider dataP = new DataProvider();
            NgonNgu      pl    = null;
            string       query = "Select n.MaNgonNgu,TenNgonNgu from NgonNgu n,Sach s where n.MaNgonNgu=s.MaNgonNgu and MaSach='" + maSach + "'";
            DataTable    data  = dataP.ExecuteQuery(query);

            foreach (DataRow item in data.Rows)
            {
                pl = new NgonNgu(item);
                return(pl);
            }

            return(pl);
        }
Exemple #12
0
        public List <NgonNgu> DSNgonNgu()
        {
            SqlDataReader  d      = DALHelper.ExecuteReader(DALHelper.ConnectionString, CommandType.StoredProcedure, "tblNgonNgu_DS", null);//chỗ này để ý cuối là null
            List <NgonNgu> mylist = new List <NgonNgu>();

            while (d.Read())
            {
                NgonNgu nn = new NgonNgu();
                //chỗ này truyền thuộc tính phải đúng thứ tự như trong bảng sql
                nn.MaNgonNgu  = d[0].ToString();
                nn.TenNgonNgu = d[1].ToString();
                mylist.Add(nn);
            }
            d.Dispose();
            return(mylist);
        }
Exemple #13
0
        /// <summary>
        /// Chỗ này truyền vào tương tự hàm sửa.cũng theo khóa chính
        /// </summary>
        /// <param name="Ma"></param>
        /// <returns></returns>
        public NgonNgu LayNgonNgu(string Ma)
        {
            SqlParameter[] parm = new SqlParameter[] {
                new SqlParameter(PARM_MANGONNGU, SqlDbType.NVarChar, 30)
            };
            parm[0].Value = Ma;
            SqlDataReader d  = DALHelper.ExecuteReader(DALHelper.ConnectionString, CommandType.StoredProcedure, "tblNgonNgu_Lay1", parm);
            NgonNgu       nn = new NgonNgu();

            if (d.Read())
            {
                nn.MaNgonNgu  = d[0].ToString();
                nn.TenNgonNgu = d[1].ToString();
            }
            return(nn);
        }
Exemple #14
0
        protected void btAddApprover_Click(object sender, EventArgs e)
        {
            try
            {
                if (!isUpdate())
                {
                    sec             = new NgonNgu();
                    sec.Name        = tbxName.Text;
                    sec.Description = tbxDescription.Text;
                }
                else
                {
                    sec.Name        = tbxName.Text;
                    sec.Description = tbxDescription.Text;
                }
                if (!isUpdate())
                {
                    if (validateSecurity(sec))
                    {
                        um.addNgonNgu(sec);
                        tbxDescription.Text = "";
                        tbxName.Text        = "";
                    }
                    else
                    {
                        Logger.logmessage(classobject, "btAddApprover_Click", "Validate fail 4 inssert " + sec.Name);
                    }
                }
                else if (um.validateSecName4Update(sec.Name, sec.ID))
                {
                    um.updateNgonNgu(sec);
                    tbxDescription.Text = "";
                    tbxName.Text        = "";
                }
                else
                {
                    Logger.logmessage(classobject, "btAddApprover_Click", "Validate fail 4 update " + sec.Name);
                }

                Session[Su_NgonNguLogic.SESSION_SEC_ID] = null;
                Response.Redirect("QLNgonNgu.aspx", false);
            }
            catch (Exception ex)
            {
                Logger.logmessage(classobject, "btAddApprover_Click", ex.Message + ex.StackTrace); Response.Redirect("~/ThongBaoLoi.aspx", false);
            }
        }
Exemple #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (Session[Su_NgonNguLogic.SESSION_SEC_ID] != null)
                    {
                        btAddApprover.Text = "Cập nhật";
                        sec = um.getNgonNgu(Int32.Parse(Session[Su_NgonNguLogic.SESSION_SEC_ID].ToString()));
                        if (sec != null)
                        {
                            tbxName.Text        = sec.Name;
                            tbxDescription.Text = sec.Description;
                        }
                    }
                    else
                    {
                        sec = new NgonNgu();
                    }

                    listAllSec();
                }
                catch (Exception ex)
                {
                    Logger.logmessage(classobject, "Page_Load", ex.Message + ex.StackTrace); Response.Redirect("~/ThongBaoLoi.aspx", false);
                }
            }
            else
            {
                string tId = "";
                if (Session[Su_NgonNguLogic.SESSION_SEC_ID] != null)
                {
                    tId = Session[Su_NgonNguLogic.SESSION_SEC_ID].ToString();
                    sec = new NgonNgu();
                    int iId = 0;
                    Int32.TryParse(tId, out iId);
                    sec.ID          = iId;
                    sec.Name        = tbxName.Text;
                    sec.Description = tbxDescription.Text;
                }
            }
        }
Exemple #16
0
        public async Task <int> Sua(NgonNguRequest model)
        {
            NgonNgu ngonngu = _context.NgonNgus.Where(a => a.ID_NgonNgu == model.ID_NgonNgu).FirstOrDefault();

            if (ngonngu == null)
            {
                throw new Exception("Ngôn ngữ không tồn tại.");
            }
            ngonngu.ModifyBy   = model.ModifyBy;
            ngonngu.CreateBy   = model.CreateBy;
            ngonngu.Delete     = model.Delete;
            ngonngu.ID_NgonNgu = model.ID_NgonNgu;
            ngonngu.TenNgonNgu = model.TenNgonNgu;
            ngonngu.ModifyDate = DateTime.Now;

            _context.NgonNgus.Update(ngonngu);
            await _context.SaveChangesAsync();

            return(ngonngu.ID_NgonNgu);
        }
Exemple #17
0
        protected bool validateSecurity(NgonNgu sec)
        {
            bool result = true;

            if (!um.validateSecName(sec.Name))
            {
                result = false;
                Response.Write("<script language='javascript'> { alert('Tên này đã có trong hệ thống. Xin chọn một tên khác');}</script>");
            }
            if (!um.validateSecNameNull(sec.Name))
            {
                result = false;
                Response.Write("<script language='javascript'> { alert('Tên không được phép để trống');}</script>");
            }
            if (!um.validateSecNameNull(sec.Description))
            {
                result = false;
                Response.Write("<script language='javascript'> { alert('Mô tả không được phép để trống');}</script>");
            }
            return(result);
        }
 private void Insert(object sender, EventArgs e)
 {
     try
     {
         NgonNgu t = new NgonNgu();
         t.maNN  = LanguageID.Text;
         t.tenNN = Language.Text;
         if (t.isNull())
         {
             toolTip1.ToolTipTitle = "Warning";
             toolTip1.Show("Please enter full information", windowsUIButtonPanel1, windowsUIButtonPanel1.Location, 5000);
             return;
         }
         else
         {
             if (nn.them(t))
             {
                 Categories_Load(sender, e);
                 resetText();
             }
             else
             {
                 if (nn.sua(t))
                 {
                     Categories_Load(sender, e);
                     resetText();
                 }
                 else
                 {
                     return;
                 }
             }
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message, "Oops", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #19
0
        private void txtMaSach_TextChanged(object sender, EventArgs e)
        {
            try
            {
                string      MaSach   = dgvBook.SelectedCells[0].OwningRow.Cells["MaSach"].Value.ToString();
                PhanLoaiDAO phanloai = new PhanLoaiDAO();
                PhanLoai    pl       = phanloai.GetListPhanLoaiByMaSach(txtMaSach.Text);
                int         index    = -1;
                int         i        = 0;
                foreach (PhanLoai item in cbTheLoai.Items)
                {
                    if (item.MaLoai == pl.MaLoai)
                    {
                        index = i;
                        break;
                    }
                    i++;
                }
                cbTheLoai.SelectedIndex = index;

                NgonNguDAO nn      = new NgonNguDAO();
                NgonNgu    ngonNgu = nn.GetListNgonNguByMaSach(txtMaSach.Text);
                int        index1  = -1;
                int        j       = 0;
                foreach (NgonNgu item in cbNgonNgu.Items)
                {
                    if (item.MaNgonNgu == ngonNgu.MaNgonNgu)
                    {
                        index1 = j;
                        break;
                    }
                    j++;
                }
                cbNgonNgu.SelectedIndex = index1;
            }
            catch
            {
            }
        }
Exemple #20
0
        private void btnCheckTL_Click(object sender, EventArgs e)
        {
            try
            {
                TaiLieu taiLieu = TaiLieu.GetTaiLieuTheoMa(txtMaTaiLieu.Text);
                if (taiLieu == null)
                {
                    throw new Exception("Không tìm thấy tài liệu với mã tương ứng");
                }

                txtIDTL.Text       = taiLieu.IDTaiLieu.ToString();
                txtNhanDe.Text     = taiLieu.NhanDe.ToString();
                txtSoLuong.Text    = taiLieu.SoLuong.ToString();
                txtSLCoSan.Text    = TaiLieu.SoLuongCoSan(taiLieu.IDTaiLieu).ToString();
                txtLanXuatBan.Text = taiLieu.LanXuatBan.ToString();
                txtSoTrang.Text    = taiLieu.SoTrang.ToString();

                NhaXuatBan nxb = NhaXuatBan.TimNXBTheoID(taiLieu.IDNXB);
                txtNXB.Text = nxb.TenNhaXuatBan;
                NgonNgu nn = NgonNgu.LayDSNgonNgu().Find(c => c.IDNgonNgu == taiLieu.IDNgonNgu);
                txtNgonNgu.Text    = nn.TenNgonNgu;
                txtNamXuatBan.Text = taiLieu.NamXuatBan.ToString();
                TacGia tg = TacGia.LayDSTacGia().Find(c => c.IDTacGia == taiLieu.IDTacGia);
                txtTacGia.Text = tg.TenTacGia;
                TheLoai theLoai = TheLoai.GetDanhSachTheLoai().Find(c => c.IDTheLoai == taiLieu.IDTheLoai);
                txtTheLoai.Text = theLoai.TenTheLoai;
                GiaXep gx = GiaXep.GetDSGiaXep().Find(c => c.IDGiaXep == taiLieu.IDGiaXep);
                txtGiaXep.Text = gx.MaGiaXep;
                Kho kho = Kho.GetDanhSachKho().Find(c => c.IDKho == gx.IDKho);
                txtKho.Text        = kho.MaKho;
                txtNamXuatBan.Text = taiLieu.NamXuatBan.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                txtMaTaiLieu.Focus();
            }
        }
Exemple #21
0
        public ReturnResult <NgonNgu> CreateNgonNgu(NgonNgu NgonNgu)
        {
            DbProvider provider     = new DbProvider();
            var        result       = new ReturnResult <NgonNgu>();
            string     outCode      = String.Empty;
            string     outMessage   = String.Empty;
            string     totalRecords = String.Empty;

            try
            {
                provider.SetQuery("NgonNgu_CREATE", System.Data.CommandType.StoredProcedure)
                .SetParameter("TenNgonNgu", SqlDbType.NVarChar, NgonNgu.TenNgonNgu, 50, ParameterDirection.Input)
                .SetParameter("ErrorCode", System.Data.SqlDbType.NVarChar, DBNull.Value, 100, System.Data.ParameterDirection.Output)
                .SetParameter("ErrorMessage", System.Data.SqlDbType.NVarChar, DBNull.Value, 4000, System.Data.ParameterDirection.Output)
                .GetSingle <NgonNgu>(out NgonNgu).Complete();

                provider.GetOutValue("ErrorCode", out outCode)
                .GetOutValue("ErrorMessage", out outMessage);

                if (outCode != "0" || outCode == "")
                {
                    result.ErrorCode    = outCode;
                    result.ErrorMessage = outMessage;
                }
                else
                {
                    result.Item         = NgonNgu;
                    result.ErrorCode    = outCode;
                    result.ErrorMessage = outMessage;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(result);
        }
Exemple #22
0
        private void LoadDB()
        {
            List <LinhVuc> listlv = lvbll.DSLV();

            LinhVuc.DataSource     = listlv;
            LinhVuc.DataTextField  = "TenLinhVuc";
            LinhVuc.DataValueField = "MaLinhVuc";
            LinhVuc.DataBind();
            List <TheLoai> listtl = tlbll.DSTL();

            TheLoai.DataSource     = listtl;
            TheLoai.DataTextField  = "TenTheLoai";
            TheLoai.DataValueField = "MaTheLoai";
            TheLoai.DataBind();
            List <NgonNgu> listnn = ngvbll.DSNgonNgu();

            NgonNgu.DataSource     = listnn;
            NgonNgu.DataTextField  = "TenNgonNgu";
            NgonNgu.DataValueField = "MaNgonNgu";
            NgonNgu.DataBind();
            List <TacGia> listtg = tgbll.DSTacGia();

            tacgia.DataTextField  = "HoTenTacGia";
            tacgia.DataValueField = "MaTacGia";
            tacgia.DataSource     = listtg;
            tacgia.DataBind();
            List <NhaXuatBan> listnxb = nxbbll.DSNXB();

            NhaXB.DataSource     = listnxb;
            NhaXB.DataTextField  = "TenNXB";
            NhaXB.DataValueField = "MaNXB";
            NhaXB.DataBind();
            List <Sach> mylist = sbll.DSSach();

            grvSach.DataSource = mylist;
            grvSach.DataBind();
        }
Exemple #23
0
        public ReturnResult <NgonNgu> DeleteNgonNgu(int id)
        {
            DbProvider provider     = new DbProvider();
            var        result       = new ReturnResult <NgonNgu>();
            string     outCode      = String.Empty;
            string     outMessage   = String.Empty;
            string     totalRecords = String.Empty;
            NgonNgu    item         = new NgonNgu();

            try
            {
                provider.SetQuery("NgonNgu_DELETE", CommandType.StoredProcedure)
                .SetParameter("NgonNguID", SqlDbType.Int, id, ParameterDirection.Input)
                .SetParameter("ErrorCode", SqlDbType.NVarChar, DBNull.Value, 100, System.Data.ParameterDirection.Output)
                .SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, System.Data.ParameterDirection.Output)
                .ExcuteNonQuery().Complete();

                provider.GetOutValue("ErrorCode", out outCode)
                .GetOutValue("ErrorMessage", out outMessage);

                if (outCode != "0")
                {
                    result.Failed(outCode, outMessage);
                }
                else
                {
                    result.ErrorCode    = "0";
                    result.ErrorMessage = "";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(result);
        }
Exemple #24
0
 public ReturnResult <NgonNgu> EditNgonNgu(NgonNgu NgonNgu)
 {
     return(ngonNguDAL.EditNgonNgu(NgonNgu));
 }
Exemple #25
0
 public ReturnResult <NgonNgu> CreateNgonNgu(NgonNgu NgonNgu)
 {
     return(ngonNguDAL.CreateNgonNgu(NgonNgu));
 }
 private void btnngonngu_Click(object sender, EventArgs e)
 {
     NgonNgu formNgonNgu = new NgonNgu();
     formNgonNgu.ShowDialog();
 }
Exemple #27
0
 public bool them(NgonNgu n)
 {
     return(ngonNgu.insert(n));
 }
        public void update(NgonNgu n)
        {
            string sqlCommand = string.Format("update NGONNGU set TenNN = N'{0}' where MaNN = '{1}' ", n.tenNN, n.maNN);

            Excute(sqlCommand);
        }
        public IActionResult CreateNgonNgu(NgonNgu NgonNgu)
        {
            var result = NgonNguBUS.CreateNgonNgu(NgonNgu);

            return(Ok(result));
        }
Exemple #30
0
        void Set_CbLoaiTimTheo(string loai = "TacGia")
        {
            switch (loai)
            {
            case "NgonNgu":
            {
                lbTimTheo.Visible           = cbLoaiTimTheo.Visible = true;
                lbTimTheo.Text              = "Chọn ngôn ngữ";
                cbLoaiTimTheo.DataSource    = NgonNgu.LayDSNgonNgu();
                cbLoaiTimTheo.ValueMember   = "IDNgonNgu";
                cbLoaiTimTheo.DisplayMember = "TenNgonNgu";
                break;
            }

            case "NhaXuatBan":
            {
                lbTimTheo.Visible           = cbLoaiTimTheo.Visible = true;
                lbTimTheo.Text              = "Chọn NXB";
                cbLoaiTimTheo.DataSource    = NhaXuatBan.LayDSNhaXuatBan();
                cbLoaiTimTheo.ValueMember   = "IDNhaXuatBan";
                cbLoaiTimTheo.DisplayMember = "TenNhaXuatBan";
                break;
            }

            case "GiaXep":
            {
                lbTimTheo.Visible           = cbLoaiTimTheo.Visible = true;
                lbTimTheo.Text              = "Chọn giá xếp";
                cbLoaiTimTheo.DataSource    = GiaXep.GetDSGiaXep();
                cbLoaiTimTheo.ValueMember   = "IDGiaXep";
                cbLoaiTimTheo.DisplayMember = "MaGiaXep";
                break;
            }

            case "TheLoai":
            {
                lbTimTheo.Visible           = cbLoaiTimTheo.Visible = true;
                lbTimTheo.Text              = "Chọn thể loại";
                cbLoaiTimTheo.DataSource    = TheLoai.GetDanhSachTheLoai();
                cbLoaiTimTheo.ValueMember   = "IDTheLoai";
                cbLoaiTimTheo.DisplayMember = "TenTheLoai";
                break;
            }

            case "TacGia":
            {
                lbTimTheo.Visible           = cbLoaiTimTheo.Visible = true;
                lbTimTheo.Text              = "Chọn tác giả";
                cbLoaiTimTheo.DataSource    = TacGia.LayDSTacGia();
                cbLoaiTimTheo.ValueMember   = "IDTacGia";
                cbLoaiTimTheo.DisplayMember = "TenTacGia";
                break;
            }

            default:
            {
                lbTimTheo.Visible        = cbLoaiTimTheo.Visible = false;
                lbTimTheo.Text           = "TatCa";
                cbLoaiTimTheo.DataSource = new int[] { 0 };
                break;
            }
            }
        }
        public IActionResult UpdateNgonNgu(NgonNgu NgonNgu)
        {
            var result = NgonNguBUS.EditNgonNgu(NgonNgu);

            return(Ok(result));
        }