Ejemplo n.º 1
0
        public static bool Insert(SurveyEntity survey, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_SurveyInsert");

            db.AddInParameter(command, "MyUniversity", DbType.String, survey.MyUniversity);
            db.AddInParameter(command, "UniversityName", DbType.String, survey.UniversityName);
            db.AddInParameter(command, "UniversityAddress", DbType.String, survey.UniversityAddress);
            db.AddInParameter(command, "TypeOfResidence", DbType.String, survey.TypeOfResidence);
            db.AddInParameter(command, "TypeOfResidenceOption", DbType.String, survey.TypeOfResidenceOption);
            db.AddInParameter(command, "NameOfResidence", DbType.String, survey.NameOfResidence);
            db.AddInParameter(command, "AddressOfResidence", DbType.String, survey.AddressOfResidence);
            db.AddInParameter(command, "PropertyOwnerComment", DbType.String, survey.PropertyOwnerComment);
            db.AddInParameter(command, "Email", DbType.String, survey.Email);

            if (transaction == null)
            {
                db.ExecuteNonQuery(command);
            }
            else
            {
                db.ExecuteNonQuery(command, transaction);
            }

            return true;
        }
Ejemplo n.º 2
0
        public static bool Insert(SurveyEntity survey, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_SurveyInsert");

            db.AddInParameter(command, "MyUniversity", DbType.String, survey.MyUniversity);
            db.AddInParameter(command, "UniversityName", DbType.String, survey.UniversityName);
            db.AddInParameter(command, "UniversityAddress", DbType.String, survey.UniversityAddress);
            db.AddInParameter(command, "TypeOfResidence", DbType.String, survey.TypeOfResidence);
            db.AddInParameter(command, "TypeOfResidenceOption", DbType.String, survey.TypeOfResidenceOption);
            db.AddInParameter(command, "NameOfResidence", DbType.String, survey.NameOfResidence);
            db.AddInParameter(command, "AddressOfResidence", DbType.String, survey.AddressOfResidence);
            db.AddInParameter(command, "PropertyOwnerComment", DbType.String, survey.PropertyOwnerComment);
            db.AddInParameter(command, "Email", DbType.String, survey.Email);

            if (transaction == null)
            {
                db.ExecuteNonQuery(command);
            }
            else
            {
                db.ExecuteNonQuery(command, transaction);
            }

            return(true);
        }
Ejemplo n.º 3
0
 public static bool Insert(SurveyEntity survey)
 {
     Database db = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);
     return SurveyDAO.Insert(survey, db, null);
 }
Ejemplo n.º 4
0
        public static bool Insert(SurveyEntity survey)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);

            return(SurveyDAO.Insert(survey, db, null));
        }