private object[] UpdateMaster(EPerVacaProg entity) { IDOUpdate objDO = new RHDOMnt.PerVacaProg(); if (entity.EntityState == EntityState.Unchanged) return null; object[] objRet = null; switch (entity.EntityState) { case EntityState.Added: objRet = objDO.Insert(entity); break; case EntityState.Modified: if (entity.StAnulado == ConstFlagEstado.DESACTIVADO) objDO.Update(entity); else objDO.Delete(entity); break; case EntityState.Deleted: objDO.Delete(entity); break; } return objRet; }
private ArrayList BuildParamInterface(EPerVacaProg value) { ArrayList arrPrm = new ArrayList(); arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, value.IdEmpresa)); arrPrm.Add(DataHelper.CreateParameter("@pidPersonal", SqlDbType.Char, 7, value.IdPersonal)); arrPrm.Add(DataHelper.CreateParameter("@pidPeriVac", SqlDbType.Char, 4, value.IdPeriVac)); arrPrm.Add(DataHelper.CreateParameter("@pnuSecuen", SqlDbType.SmallInt, value.NuSecuen)); return arrPrm; }
private void DeleteMaster(EPerVacaProg entity) { IDOUpdate objDO = new RHDOMnt.PerVacaProg(); if (entity.EntityState == EntityState.Unchanged) return; objDO.Delete(entity); }
private ArrayList BuildParamInterface(EPerVacaProg value) { ArrayList arrPrm = new ArrayList(); arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, value.IdEmpresa)); arrPrm.Add(DataHelper.CreateParameter("@pidPersonal", SqlDbType.Char, 7, value.IdPersonal)); arrPrm.Add(DataHelper.CreateParameter("@pidPeriVac", SqlDbType.Char, 4, value.IdPeriVac)); arrPrm.Add(DataHelper.CreateParameter("@pnuSecuen", SqlDbType.SmallInt, value.NuSecuen)); arrPrm.Add(DataHelper.CreateParameter("@pidForPago", SqlDbType.Char, 3, value.IdForPago)); arrPrm.Add(DataHelper.CreateParameter("@pidPlanilla", SqlDbType.Char, 3, value.IdPlanilla)); arrPrm.Add(DataHelper.CreateParameter("@pidConRemu", SqlDbType.Char, 3, value.IdConRemu)); arrPrm.Add(DataHelper.CreateParameter("@pnuDiasVaca", SqlDbType.SmallInt, value.NuDiasVaca)); arrPrm.Add(DataHelper.CreateParameter("@pmtVaca", SqlDbType.Decimal, value.MtVaca)); arrPrm.Add(DataHelper.CreateParameter("@pidPeriAnualIni", SqlDbType.Char, 4, value.IdPeriAnualIni)); arrPrm.Add(DataHelper.CreateParameter("@pnuProcAnualIni", SqlDbType.SmallInt, value.NuProcAnualIni)); arrPrm.Add(DataHelper.CreateParameter("@pfeVacaIni", SqlDbType.DateTime, (value.FeVacaIni.HasValue ? (object)value.FeVacaIni : DBNull.Value))); arrPrm.Add(DataHelper.CreateParameter("@pidPeriAnualFin", SqlDbType.Char, 4, value.IdPeriAnualFin)); arrPrm.Add(DataHelper.CreateParameter("@pnuProcAnualFin", SqlDbType.SmallInt, value.NuProcAnualFin)); arrPrm.Add(DataHelper.CreateParameter("@pfeVacaFin", SqlDbType.DateTime, (value.FeVacaFin.HasValue ? (object)value.FeVacaFin : DBNull.Value))); arrPrm.Add(DataHelper.CreateParameter("@pnuDiasGozado", SqlDbType.Decimal, value.NuDiasGozado)); arrPrm.Add(DataHelper.CreateParameter("@pstVaca", SqlDbType.Char, 3, value.StVaca)); arrPrm.Add(DataHelper.CreateParameter("@pstAnulado", SqlDbType.Char, 1, value.StAnulado)); return arrPrm; }