public IDataReader SHPR_TICKET_ATT_LIST(AttendEntity oBe) { try { oDb = oDg.getDataBase(); oCon = oDg.getConnection(); if (oCon.State == ConnectionState.Closed) { oCon.Open(); } //var ocmd = oDb.GetStoredProcCommand("up_ConsultarTicket_Sebastian", oBe.TIC_Id, var ocmd = oDb.GetStoredProcCommand("up_ConsultarAtencion", oBe.ATE_Id); ocmd.CommandTimeout = 2000; var odr = oDb.ExecuteReader(ocmd); return(odr); } catch (Exception ex) { throw ex; } finally { oCon.Close(); } }
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)); } }
public List <AttendEntity> SHPR_TICKET_ATT_LIST(AttendEntity oBe) { using (var odr = oDa.SHPR_TICKET_ATT_LIST(oBe)) { var oList = new List <AttendEntity>(); ((IList)oList).LoadFromReader <AttendEntity>(odr); return(oList); } }
public void SHPR_TICKET_ATT_INSERT(AttendEntity oBe) { try { oDa.SHPR_TICKET_ATT_INSERT(oBe); } catch (Exception ex) { throw new ArgumentException(ex.Message); } }
/// <summary> /// 保存表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="entity">实体对象</param> /// <returns></returns> public void SaveForm(string keyValue, AttendEntity entity) { try { service.SaveForm(keyValue, entity); } catch (Exception) { throw; } }
public void Attend(int lectureId, int userId) { if (_attendRepository.Table.Any(x => x.AttendLectureIdFk == lectureId && x.AttendUserIdFk == userId)) { throw new UserAlreadyAttendedException(); } var attend = new AttendEntity { AttendLectureIdFk = lectureId, AttendUserIdFk = userId, }; _attendRepository.Insert(attend); _attendRepository.SaveAll(); }
public HttpResponseMessage SHPR_TICKET_ATT_LIST(AttendEntity oBe) { try { if (string.IsNullOrWhiteSpace((string)HttpContext.Current.Session["username"])) { return(Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "Acceso no autorizado.")); } var oBr = new TicketRule(); var oList = oBr.SHPR_TICKET_ATT_LIST(oBe); return(Request.CreateResponse(HttpStatusCode.OK, oList)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public void SHPR_TICKET_ATT_INSERT(AttendEntity oBe) { try { oDb = oDg.getDataBase(); oCon = oDg.getConnection(); if (oCon.State == ConnectionState.Closed) { oCon.Open(); } using (var obts = oCon.BeginTransaction()) { try { using (var ocmd = oDb.GetStoredProcCommand("up_RegistrarAtencion", oBe.ATE_TIC_Id, oBe.ATE_FEC_INI, oBe.ATE_FEC_FIN, oBe.ATE_FLAG_RES, oBe.ATE_DET_TRA)) { ocmd.CommandTimeout = 2000; oDb.ExecuteNonQuery(ocmd, obts); obts.Commit(); } } catch (Exception ex) { obts.Rollback(); throw new ArgumentException(ex.Message); } } } catch (Exception ex) { throw new ArgumentException(ex.Message); } finally { oCon.Close(); } }