public static List <InstituteType> GetInstituteTypeByLanguageId(int Id = 0, string connection = "") { List <InstituteType> Institutetype = new List <InstituteType>(); using (SqlConnection con = new SqlConnection(connection)) { SqlCommand cmd = new SqlCommand("sp_ManageLookup", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter { ParameterName = "@Mode", Value = "GetbyLookupId" }); cmd.Parameters.Add(new SqlParameter { ParameterName = "@LookupId", Value = 35 }); cmd.Parameters.Add(new SqlParameter() { ParameterName = "@LanguageId", Value = Id }); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { InstituteType institutetype = new InstituteType(); institutetype.Id = Convert.ToInt32(rdr["id"]); institutetype.Name = rdr["description"].ToString(); Institutetype.Add(institutetype); } } return(Institutetype); }
public async Task <IActionResult> InsertInstituteType(string type) { var instituteType = new InstituteType() { Type = type, }; var institutes = await unitOfWork.GetRepository <InstituteType>().InsertAsync(instituteType); return(ApiResponder.RespondSuccessTo(HttpStatusCode.Ok, institutes)); }
public static Result <Institute> Create(string name, InstituteType type) { return(Result.Ok( new Institute() { Id = ObjectId.GenerateNewId(), Name = name, Type = type } )); }
public async Task <List <InstituteModel> > GetInstitutes([FromQuery] string directionCode, [FromQuery] List <Subject> subjects, InstituteType type) { return(await _institutesService.GetInstitutes(directionCode, subjects)); }