Esempio n. 1
0
        public bool RemoveCollege(RemoveCollegeDTO obj)
        {
            bool       res = false;
            SqlCommand cmd = new SqlCommand("sp_RemoveCollege");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_CollegeId", obj.CollegeId);
            int result = new DBlayer().ExecuteNonQuery(cmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }
Esempio n. 2
0
        public HttpResponseMessage RemoveCollege(RemoveCollegeDTO obj)
        {
            HttpResponseMessage message;

            try
            {
                CollegeDAL dal    = new CollegeDAL();
                var        dynobj = new { result = dal.RemoveCollege(obj) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynobj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "something Wrong.Try Again!" });
            }
            return(message);
        }