Exemplo n.º 1
1
        public bool Delete(OptionCategory ropertyOptionCategory, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_OptionCategoryDelete");
            db.AddInParameter(command, "OptionCategoryId", DbType.Guid, ropertyOptionCategory.OptionCategoryId);

            db.ExecuteNonQuery(command, transaction);
            return true;
        }
Exemplo n.º 2
0
        public bool Update(OptionCategory OptionCategory, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_OptionCategoryUpdate");

            db.AddInParameter(command, "Name", DbType.String, OptionCategory.Name);
            db.AddInParameter(command, "Description", DbType.String, OptionCategory.Description);
            db.AddInParameter(command, "OptionCategoryId", DbType.Int16, OptionCategory.OptionCategoryId);
            db.AddInParameter(command, "UpdatedBy", DbType.Guid, OptionCategory.CreatedBy);
            db.AddInParameter(command, "UpdatedDate", DbType.DateTime, OptionCategory.CreatedDate);

            db.AddOutParameter(command, "OptionCategoryId", DbType.Int16, 3);

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

            OptionCategory.OptionCategoryId = Convert.ToInt16(db.GetParameterValue(command, "OptionCategoryId").ToString());


            return(true);
        }
Exemplo n.º 3
0
        public bool Update(OptionCategory OptionCategory, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_OptionCategoryUpdate");

            db.AddInParameter(command, "Name", DbType.String, OptionCategory.Name);
            db.AddInParameter(command, "Description", DbType.String, OptionCategory.Description);
            db.AddInParameter(command, "OptionCategoryId", DbType.Int16, OptionCategory.OptionCategoryId);
            db.AddInParameter(command, "UpdatedBy", DbType.Guid, OptionCategory.CreatedBy);
            db.AddInParameter(command, "UpdatedDate", DbType.DateTime, OptionCategory.CreatedDate);

            db.AddOutParameter(command, "OptionCategoryId", DbType.Int16, 3);

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

            OptionCategory.OptionCategoryId = Convert.ToInt16(db.GetParameterValue(command, "OptionCategoryId").ToString());

            return true;
        }
Exemplo n.º 4
0
        public bool Delete(OptionCategory ropertyOptionCategory, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_OptionCategoryDelete");

            db.AddInParameter(command, "OptionCategoryId", DbType.Guid, ropertyOptionCategory.OptionCategoryId);


            db.ExecuteNonQuery(command, transaction);
            return(true);
        }
Exemplo n.º 5
0
        public bool Delete(OptionCategory ropertyOptionCategory)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);

            return(this.Delete(ropertyOptionCategory, db, null));
        }
Exemplo n.º 6
0
        public bool Insert(OptionCategory OptionCategory)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);

            return(this.Insert(OptionCategory, db, null));
        }
Exemplo n.º 7
0
 public bool Update(OptionCategory OptionCategory)
 {
     Database db = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);
     return this.Update(OptionCategory, db, null);
 }