HBM.GeneralManagement.BedTypeDAO.Insert C# (CSharp) Method

Insert() public method

public Insert ( BedType bedType ) : bool
bedType BedType
return bool
        public bool Insert(BedType bedType)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand command = db.GetStoredProcCommand("usp_BedTypeInsert");

            db.AddInParameter(command, "@CompanyId", DbType.Int32, bedType.CompanyId);
            db.AddInParameter(command, "@BedTypeName", DbType.String, bedType.BedTypeName);
            db.AddInParameter(command, "@BedTypeDescription", DbType.String, bedType.BedTypeDescription);
            db.AddInParameter(command, "@CreatedBy", DbType.Int32, bedType.CreatedBy);
            db.AddInParameter(command, "@CreatedDate", DbType.DateTime, bedType.CreatedDate);
            db.AddInParameter(command, "@UpdatedBy", DbType.Int32, bedType.UpdatedBy);
            db.AddInParameter(command, "@UpdatedDate", DbType.DateTime, bedType.UpdatedDate);
            db.AddInParameter(command, "@StatusId", DbType.Int32, bedType.StatusId);

            db.ExecuteNonQuery(command);

            return true;
        }