public HttpResponseMessage SHPR_TICKET_ATT_INSERT(AttendEntity oBe) { try { if (string.IsNullOrWhiteSpace((string)HttpContext.Current.Session["username"])) { return(Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "Acceso no autorizado.")); } if (oBe.ATE_FEC_INI == null) { throw new ArgumentException("Seleccione una fecha incial."); } if (oBe.ATE_FEC_FIN == null) { throw new ArgumentException("Seleccione una fecha final."); } if (oBe.ATE_DET_TRA.Trim() == "") { throw new ArgumentException("Ingrese el procedimiento del trabajo realizado."); } var oBr = new TicketRule(); oBr.SHPR_TICKET_ATT_INSERT(oBe); return(Request.CreateResponse(HttpStatusCode.OK, "Operación concretada con exito.")); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }