// handle manipulations
        public Result<List<SinhVien_ett>> select_all_sinhvien()
        {
            Result<List<SinhVien_ett>> rs = new Result<List<SinhVien_ett>>();
            try
            {
                List<SinhVien_ett> lst = new List<SinhVien_ett>();
                // remember : linq select all table "tbl_sinhvien"
                var dt = db.tbl_sinhviens;

                if (dt.Count() > 0)
                {
                    foreach (tbl_sinhvien item in dt)
                    {
                        SinhVien_ett temp = new SinhVien_ett(item);
                        lst.Add(temp);
                    }
                    rs.data = lst;
                    rs.errorCode = ErrorCode.Sucess;

                }
                else
                {
                    rs.data = null;
                    rs.errorCode = ErrorCode.NaN;
                    rs.errorInfor = Constants.empty_data;
                }
                return rs;
            }
            catch (Exception ex)
            {
                rs.data = null;
                rs.errorInfor = ex.ToString();
                rs.errorCode = ErrorCode.False;
                return rs;
            }
        }
        public Result<List<SinhVien_ett>> select_by_fields(string nameInput, string how_to_search)
        {
            Result<List<SinhVien_ett>> rs = new Result<List<SinhVien_ett>>();
            try
            {
                IQueryable<tbl_sinhvien> dt = null;
                List<SinhVien_ett> lst = new List<SinhVien_ett>();
                switch (how_to_search)
                {
                    case "masv":
                        dt = db.tbl_sinhviens.Where(o => o.masv.Contains(nameInput));
                        break;
                    case "hoten":
                        dt = db.tbl_sinhviens.Where(o => o.hoten.Contains(nameInput));
                        break;
                    case "noisinh":
                        dt = db.tbl_sinhviens.Where(o => o.noisinh.Contains(nameInput));
                        break;
                    case "makhoa":
                        dt = db.tbl_sinhviens.Where(o => o.makhoa.Contains(nameInput));
                        break;
                    default:
                        break;
                }

                if (dt.Count() > 0)
                {
                    foreach (tbl_sinhvien item in dt)
                    {
                        SinhVien_ett temp = new SinhVien_ett(item);
                        lst.Add(temp);
                    }
                    rs.errorCode = ErrorCode.Sucess;
                    rs.data = lst;
                }
                else
                {
                    rs.errorCode = ErrorCode.NaN;
                    rs.data = null;
                }
                return rs;
            }
            catch (Exception e)
            {
                rs.data = null;
                rs.errorCode = ErrorCode.False;
                rs.errorInfor = e.ToString();
                return rs;
            }
        }
        public Result<bool> insert_sinhvien(SinhVien_ett sinhvien)
        {
            Result<bool> rs = new Result<bool>();
            try
            {
                // create new tbl_khoa to insert to datacontext
                tbl_sinhvien temp = new tbl_sinhvien();
                temp.masv = sinhvien.masv;
                temp.hoten = sinhvien.hoten;
                temp.noisinh = sinhvien.noisinh;
                temp.makhoa = sinhvien.makhoa;

                // remember : linq insert data
                db.tbl_sinhviens.InsertOnSubmit(temp);
                // remember : all manipulations such as insert, update, delete have to use this command
                db.SubmitChanges();

                rs.data = true;
                rs.errorCode = ErrorCode.Sucess;
                return rs;
            }
            catch (Exception e)
            {
                rs.data = false;
                rs.errorCode = ErrorCode.False;
                rs.errorInfor = e.ToString();
                return rs;
            }
        }