private object[] UpdateMaster(EPrestamo entity) { IDOUpdate objDO = new RHDOMnt.Prestamo(); 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(EPrestamo 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("@pidPrestamo", SqlDbType.Char, 4, value.IdPrestamo)); arrPrm.Add(DataHelper.CreateParameter("@pidConRemu", SqlDbType.Char, 3, value.IdConRemu)); arrPrm.Add(DataHelper.CreateParameter("@pfePrestamo", SqlDbType.DateTime, value.FePrestamo)); arrPrm.Add(DataHelper.CreateParameter("@pidMoneda", SqlDbType.Char, 3, value.IdMoneda)); arrPrm.Add(DataHelper.CreateParameter("@pmtTC", SqlDbType.Decimal, value.MtTC)); arrPrm.Add(DataHelper.CreateParameter("@pmtPrestamo", SqlDbType.Decimal, value.MtPrestamo)); arrPrm.Add(DataHelper.CreateParameter("@pqtCuotas", SqlDbType.SmallInt, value.QtCuotas)); arrPrm.Add(DataHelper.CreateParameter("@pidForPago", SqlDbType.Char, 3, value.IdForPago)); arrPrm.Add(DataHelper.CreateParameter("@pidPlanilla", SqlDbType.Char, 3, value.IdPlanilla)); arrPrm.Add(DataHelper.CreateParameter("@pnuProcAnual", SqlDbType.SmallInt, value.NuProcAnual)); arrPrm.Add(DataHelper.CreateParameter("@pidTipoPrest", SqlDbType.Char, 3, value.IdTipoPrest)); arrPrm.Add(DataHelper.CreateParameter("@pstDocumento", SqlDbType.Char, 1, value.StDocumento)); arrPrm.Add(DataHelper.CreateParameter("@pdsObserva", SqlDbType.VarChar, 500, value.DsObserva)); arrPrm.Add(DataHelper.CreateParameter("@pstAnulado", SqlDbType.Char, 1, value.StAnulado)); return arrPrm; }
private void DeleteMaster(EPrestamo entity) { IDOUpdate objDO = new RHDOMnt.Prestamo(); if (entity.EntityState == EntityState.Unchanged) return; objDO.Delete(entity); }
private ArrayList BuildParamInterface(EPrestamo 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("@pidPrestamo", SqlDbType.Char, 4, value.IdPrestamo)); return arrPrm; }