Exemplo n.º 1
0
        public IHttpActionResult GetTruong()
        {
            SQL_function sql_function = new SQL_function();
            String       strQuery     = @"SELECT [SchoolID] ,[TenTruong]
  FROM [DuLieuTotNghiep].[dbo].[T_DM_Truong]";
            SqlCommand   cmd          = new SqlCommand(strQuery);
            String       json         = sql_function.GetData_Json(cmd, "sqlconnString");

            return(Json(json));
        }
Exemplo n.º 2
0
        public IHttpActionResult GetDanToc()
        {
            SQL_function sql_function = new SQL_function();
            String       strQuery     = @"SELECT [DanTocID],[TenDanToc],[Moet_DanTocID]
  FROM [DuLieuTotNghiep].[dbo].[T_DM_DanToc]";
            SqlCommand   cmd          = new SqlCommand(strQuery);
            String       json         = sql_function.GetData_Json(cmd, "sqlconnString");

            return(Json(json));
        }
Exemplo n.º 3
0
        public IHttpActionResult PostTraCuu(DataTotNghiepModel Model)
        {
            SQL_function sql_function = new SQL_function();
            String       strQuery     = @"SELECT  dbo.DataTotNghiep.ID, dbo.DataTotNghiep.HoTen, dbo.DataTotNghiep.NgaySinh, dbo.DataTotNghiep.NoiSinh, dbo.DataTotNghiep.GioiTinh, dbo.T_DM_DanToc.TenDanToc, dbo.DataTotNghiep.Truong, 
                         dbo.DataTotNghiep.KhoaThi, dbo.DataTotNghiep.HoiDong, dbo.DataTotNghiep.SoHieu, dbo.DataTotNghiep.Rot, dbo.DataTotNghiep.DauSauPhucKhao
FROM            dbo.DataTotNghiep INNER JOIN
                         dbo.T_DM_DanToc ON dbo.DataTotNghiep.DanToc = dbo.T_DM_DanToc.DanTocID 
						 WHERE (HoTen like @HoTen AND NgaySinh = @NgaySinh) OR (SoHieu like @SoHieu)"                        ;

            SqlCommand cmd = new SqlCommand(strQuery);

            cmd.Parameters.Add("@HoTen", SqlDbType.NVarChar).Value  = Model.HoTen;
            cmd.Parameters.Add("@NgaySinh", SqlDbType.Date).Value   = Model.NgaySinh;
            cmd.Parameters.Add("@SoHieu", SqlDbType.NVarChar).Value = Model.SoHieu;
            String json = sql_function.GetData_Json(cmd, "sqlconnString");

            return(Json(json));
        }