public static bool EjecutarValidacionesBeforeDelete(Spartane.Core.Classes.Detalle_Antecedentes_No_Patologicos.Detalle_Antecedentes_No_Patologicos obj)
        {
            bool ret = true;

            //NEWBUSINESSRULE_BEFOREDELETE//
            return(ret);
        }
Esempio n. 2
0
        public int Insert(Spartane.Core.Classes.Detalle_Antecedentes_No_Patologicos.Detalle_Antecedentes_No_Patologicos entity)
        {
            int rta;

            try
            {
                var padreFolio = _dataProvider.GetParameter();
                padreFolio.ParameterName = "Folio";
                padreFolio.DbType        = DbType.Int32;
                padreFolio.Value         = (object)entity.Folio ?? DBNull.Value;
                var padreFolio_Pacientes = _dataProvider.GetParameter();
                padreFolio_Pacientes.ParameterName = "Folio_Pacientes";
                padreFolio_Pacientes.DbType        = DbType.Int32;
                padreFolio_Pacientes.Value         = (object)entity.Folio_Pacientes ?? DBNull.Value;
                var padreSustancia = _dataProvider.GetParameter();
                padreSustancia.ParameterName = "Sustancia";
                padreSustancia.DbType        = DbType.Int32;
                padreSustancia.Value         = (object)entity.Sustancia ?? DBNull.Value;

                var padreFrecuencia = _dataProvider.GetParameter();
                padreFrecuencia.ParameterName = "Frecuencia";
                padreFrecuencia.DbType        = DbType.Int32;
                padreFrecuencia.Value         = (object)entity.Frecuencia ?? DBNull.Value;

                var padreCantidad = _dataProvider.GetParameter();
                padreCantidad.ParameterName = "Cantidad";
                padreCantidad.DbType        = DbType.Int32;
                padreCantidad.Value         = (object)entity.Cantidad ?? DBNull.Value;



                var empEntity =
                    _dbContext.ExecuteStoredProcedureList <Spartane.Core.Classes.StoredProcedure.sp_InsDetalle_Antecedentes_No_Patologicos>("sp_InsDetalle_Antecedentes_No_Patologicos", padreFolio_Pacientes
                                                                                                                                            , padreSustancia
                                                                                                                                            , padreFrecuencia
                                                                                                                                            , padreCantidad
                                                                                                                                            ).FirstOrDefault();

                rta = Convert.ToInt32(empEntity.Folio);
            }
            catch (ExceptionBase ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new ServiceException(ex.Message, ex);
            }

            return(rta);
        }
        public static string ReplaceQuery(string query, Spartane.Core.Classes.Detalle_Antecedentes_No_Patologicos.Detalle_Antecedentes_No_Patologicos obj)
        {
            //codigo para que reemplace los FLD
            Regex           regex    = new Regex(@"FLD\[([^\]]+)\]");
            MatchCollection matches  = regex.Matches(query);
            string          auxMatch = "";

            foreach (Match match in matches)
            {
                foreach (Capture capture in match.Captures)
                {
                    auxMatch = capture.Value.Replace("FLD[", "").Replace("]", "");
                    PropertyInfo info = obj.GetType().GetProperty(auxMatch);
                    query = GeneralHelper.ReplaceFLD(query, auxMatch, obj, info, capture.Value);
                }
            }
            return(query);
        }
 public static void EjecutarValidacionesAfterListSelAll(Spartane.Core.Classes.Detalle_Antecedentes_No_Patologicos.Detalle_Antecedentes_No_Patologicos obj)
 {
     //NEWBUSINESSRULE_AFTERLISTSELALL//
 }
 public static void EjecutarValidacionesAfterGet(Spartane.Core.Classes.Detalle_Antecedentes_No_Patologicos.Detalle_Antecedentes_No_Patologicos obj)
 {
     //NEWBUSINESSRULE_AFTERGET//
 }