public HttpResponseMessage updatequeryDetail(StudentQuery query)
        {
            try
            {
                return Request.CreateResponse(HttpStatusCode.OK, _repo.UpdatestudentQuery(query));
            }
            catch (Exception)
            {

                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
Exemplo n.º 2
0
        public bool UpdatestudentQuery(StudentQuery QueryObj)
        {
            try
            {
                StudentQuery getQuery = _context.StudentQueries.Where(x => x.QueryId == QueryObj.QueryId).FirstOrDefault();
                if (getQuery != null)
                {
                    getQuery = QueryObj;
                    _context.Entry(getQuery).State = System.Data.Entity.EntityState.Modified;
                    SaveContext();
                    return true;
                }
                return false;
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemplo n.º 3
0
        public StudentQuery AddstudentQuery(StudentQuery StudentQueryObj)
        {
            try
            {
                StudentQueryObj.CreatedDate = DateTime.Now;
                StudentQueryObj.ModifiedDate = DateTime.Now;
                StudentQuery queries = _context.StudentQueries.Add(StudentQueryObj);
                SaveContext();
                return queries;
            }
            catch (Exception ex)
            {

                throw;
            }
        }